Option Strict Off
Option Explicit On
'------------------------------------ 2023/11/09 ------------------------------------
Friend Class 屲clsRandMode

#Region "愰尵"
    Private Const 堦廃儔僕傾儞 As Double = 3.14159 * 2
    Private Structure 墌屖堏摦僇乕僪
        Dim rc堏摦懱 As RECT
        Dim 婳摴墌敿宎 As Single
        Dim 婳摴墌拞怱X As Single
        Dim 婳摴墌拞怱Y As Single
        '-------------------------------
        Dim 尰嵼偺妏儔僕傾儞 As Single
        Dim 尰嵼偺妏懍搙 As Single
        Dim 妏懍搙ABSmin As Single
        Dim 妏懍搙ABSmax As Single
        Dim 婳摴妏懍搙憹尭棪 As Single
        Dim 師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS As Single
        '-------------------------------
        Dim 尰嵼偺揰X As Single
        Dim 尰嵼偺揰Y As Single
    End Structure
    Private 堏摦懱孮() As 墌屖堏摦僇乕僪
    Private rc堏摦斖埻 As RECT
    Private m堏摦幚峴拞, m堏摦幚峴拞偺僇乕僪枃悢曄峏 As Boolean
    Private mOld僇乕僪僒僀僘幚岠抣 As Single
    Private ret As Integer
    Private bol As Boolean
    'p僾儘僷_1to5_嫟梡_RW ----------------------------------------------------------------------------------------------------------------------------------
    Private Const pp僇乕僪枃悢 As Short = 1
    Private Const pp僇乕僪僒僀僘 As Short = 2
    Private Const pp堏摦嬋慄偺夞揮妏 As Short = 3
    Private Const pp堏摦嬋慄偺敿宎 As Short = 4
    Private Const pp堏摦僗僺乕僪 As Short = 5
    Private Const pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓 As Short = 6
    'p僾儘僷_1to5_嫟梡_RW ----------------------------------------------------------------------------------------------------------------------------------
#End Region

#Region "娭悢"
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僇乕僪僗僺乕僪攞悢() As Single
        Get
            Return CSng(Val(p僇乕僪僗僺乕僪攞悢_RW(gco僾儘僷Get)))
        End Get
        Set(ByVal Value As Single)
            Call p僇乕僪僗僺乕僪攞悢_RW(gco僾儘僷Let, CStr(Value))
        End Set
    End Property
    Private Function p僇乕僪僗僺乕僪攞悢_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        Static 抣 As Single
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷婯掕抣 : 抣 = 1.0#
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Sng(0.1, 10.0#, Val(s))
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa堏摦懱孮攝楍嶌惉(ByRef 攝楍僒僀僘 As Integer) As Boolean
        ReDim 堏摦懱孮(攝楍僒僀僘)
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz堏摦懱RECT偺僒僀僘曄峏偲婳摴墌拞怱XY偺堏摦挷惍(ByRef 堏摦懱 As 墌屖堏摦僇乕僪, ByRef 斾棪暆 As Single, ByRef 斾棪崅 As Single, ByRef rc堏摦斖埻暆 As Integer, ByRef rc堏摦斖埻崅 As Integer) As Boolean
        '偙偺娭悢偺擖傝岥偱偼丄.rc堏摦懱丂偺僒僀僘偼丄偡偱偵怴偟偄僒僀僘偵偟偰偍偔丅 ( 斾棪暆 As Single, 斾棪崅 As Single )丂傪揔梡嵪傒偺僒僀僘丅
        Dim xxx, yyy As Single
        With 堏摦懱
            xxx = rc堏摦斖埻暆 - 嘳Rect暆(.rc堏摦懱)
            yyy = rc堏摦斖埻崅 - 嘳Rect崅(.rc堏摦懱)
            Do
                .尰嵼偺揰X = (.婳摴墌拞怱X + (.婳摴墌敿宎 * System.Math.Cos(.尰嵼偺妏儔僕傾儞)))
                If .尰嵼偺揰X <= 0 Then
                    .婳摴墌拞怱X = .婳摴墌拞怱X + 1
                ElseIf .尰嵼偺揰X >= xxx Then
                    .婳摴墌拞怱X = .婳摴墌拞怱X - 1
                Else
                    Exit Do
                End If
            Loop
            Do
                .尰嵼偺揰Y = (.婳摴墌拞怱Y - (.婳摴墌敿宎 * System.Math.Sin(.尰嵼偺妏儔僕傾儞)))
                If .尰嵼偺揰Y <= 0 Then
                    .婳摴墌拞怱Y = .婳摴墌拞怱Y + 1
                ElseIf .尰嵼偺揰Y >= yyy Then
                    .婳摴墌拞怱Y = .婳摴墌拞怱Y - 1
                Else
                    Exit Do
                End If
            Loop
        End With
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa堏摦斖埻偺僒僀僘曄峏(ByRef 慡暆 As Single, ByRef 慡崅 As Single, ByRef w斾棪暆 As Single, ByRef w斾棪崅 As Single) As Boolean
        Static old慡暆, old慡崅 As Integer
        ret = SetRect(rc堏摦斖埻, 0, 0, 慡暆, 慡崅)
        If old慡暆 = 0 Then old慡暆 = 慡暆
        If old慡崅 = 0 Then old慡崅 = 慡崅
        w斾棪暆 = 慡暆 / old慡暆
        w斾棪崅 = 慡崅 / old慡崅
        old慡暆 = 慡暆
        old慡崅 = 慡崅
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa堏摦懱偺僒僀僘曄峏(ByRef IDX As Integer, ByRef r斾棪暆 As Single, ByRef r斾棪崅 As Single, ByRef NewSize堏摦懱暆 As Integer, ByRef NewSize堏摦懱崅 As Integer, ByRef w尰嵼偺揰X As Integer, ByRef w尰嵼偺揰Y As Integer) As Boolean
        'If r斾棪暆 < 1 Or r斾棪崅 < 1 Then
        '    With 堏摦懱孮(IDX)
        '        qqqqq Format(NewSize堏摦懱暆 - (嘳Rect暆(.rc堏摦懱) * r斾棪暆), "#.#") + ",   " + Format(NewSize堏摦懱崅 - (嘳Rect崅(.rc堏摦懱) * r斾棪崅), "#.#")
        '    End With
        'End If
        ret = aa堏摦懱僒僀僘愝掕(IDX, NewSize堏摦懱暆, NewSize堏摦懱崅)
        With 堏摦懱孮(IDX)
            .婳摴墌拞怱X = .婳摴墌拞怱X * r斾棪暆
            .婳摴墌拞怱Y = .婳摴墌拞怱Y * r斾棪崅
            .婳摴墌敿宎 = .婳摴墌敿宎 * ((r斾棪暆 + r斾棪崅) / 2)
            bol = zz堏摦懱RECT偺僒僀僘曄峏偲婳摴墌拞怱XY偺堏摦挷惍(堏摦懱孮(IDX), r斾棪暆, r斾棪崅, 嘳Rect暆(rc堏摦斖埻), 嘳Rect崅(rc堏摦斖埻))
            '-------------------------------------------------------------------------
            bol = zz妏懍搙ABS_MinMax傪愝掕(.婳摴墌敿宎, .妏懍搙ABSmin, .妏懍搙ABSmax)
            bol = zz尰嵼偺妏懍搙MinMaxCheck(堏摦懱孮(IDX))
            w尰嵼偺揰X = .尰嵼偺揰X
            w尰嵼偺揰Y = .尰嵼偺揰Y
        End With
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa堏摦懱傪偡傋偰嶌惉(Optional ByRef 撪敔Left As Integer = 0, Optional ByRef 撪敔Top As Integer = 0, Optional ByRef 撪敔Width As Integer = 0, Optional ByRef 撪敔Height As Integer = 0) As Boolean
        Dim 堏摦懱暆, a, 堏摦懱崅 As Integer
        Dim wwhh As Single
        '-------------------------------------------------------------------------
        aa堏摦懱傪偡傋偰嶌惉 = False
        If 0 <> IsRectEmpty(rc堏摦斖埻) Then
            MsgBox("aa堏摦斖埻偺僒僀僘曄峏() 傪幚峴偟偰偔偩偝偄丅") : Exit Function
        End If
        '-------------------------------------------------------------------------
        wwhh = (嘳Rect暆(rc堏摦斖埻) + 嘳Rect崅(rc堏摦斖埻)) / 2 / System.Math.Sqrt(p僇乕僪枃悢幚岠抣)
        '-------------------------------------------------------------------------
        ReDim Preserve 堏摦懱孮(p僇乕僪枃悢幚岠抣)
        For a = 1 To p僇乕僪枃悢幚岠抣()
            With 堏摦懱孮(a)
                堏摦懱暆 = p僎乕儉僇乕僪偺僒僀僘幚岠抣() * ((wwhh * 0.3) + (wwhh * Rnd()))
                堏摦懱崅 = p僎乕儉僇乕僪偺僒僀僘幚岠抣() * ((wwhh * 0.3) + (wwhh * Rnd()))
                bol = aa堏摦懱傪堦偮嶌惉(a, 堏摦懱暆, 堏摦懱崅, 0, 0, 撪敔Left, 撪敔Top, 撪敔Width, 撪敔Height)
            End With
        Next
        mOld僇乕僪僒僀僘幚岠抣 = p僎乕儉僇乕僪偺僒僀僘幚岠抣()
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa堏摦懱僒僀僘愝掕(ByRef IDX As Integer, ByRef 堏摦懱暆 As Integer, ByRef 堏摦懱崅 As Integer) As Boolean
        gggint = SetRect(堏摦懱孮(IDX).rc堏摦懱, 0, 0, 堏摦懱暆, 堏摦懱崅)
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa堏摦懱傪堦偮嶌惉(ByRef IDX As Integer, ByRef 堏摦懱暆 As Integer, ByRef 堏摦懱崅 As Integer, Optional ByRef w尰嵼偺揰X As Integer = 0, Optional ByRef w尰嵼偺揰Y As Integer = 0, Optional ByRef 撪敔Left As Integer = 0, Optional ByRef 撪敔Top As Integer = 0, Optional ByRef 撪敔Width As Integer = 0, Optional ByRef 撪敔Height As Integer = 0) As Boolean
        Dim hh, ww, nn As Integer
        Dim 僗僞乕僩儔僕傾儞 As Single
        Dim rc As RECT
        Dim rc撪敔 As RECT
        Dim y1, x1, x3, y3 As Integer
        '-------------------------------------------------------------------------
        ret = aa堏摦懱僒僀僘愝掕(IDX, 堏摦懱暆, 堏摦懱崅)
        '2018/09/04 add @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        If (撪敔Width > 5) And (撪敔Height > 5) Then
            ret = SetRect(rc撪敔, 撪敔Left, 撪敔Top, 撪敔Left + 撪敔Width, 撪敔Top + 撪敔Height)
        Else
            ret = SetRect(rc撪敔, 0, 0, 0, 0)
        End If
        '2018/09/04 add @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        With 堏摦懱孮(IDX)
            ww = 堏摦懱暆 / 2 : hh = 堏摦懱崅 / 2 : nn = 10
            With rc堏摦斖埻
                ret = SetRect(rc, .lll + ww + nn, .ttt + hh + nn, .rrr - ww - nn, .bbb - hh - nn)
            End With
            With rc
                堏摦懱孮(IDX).尰嵼偺揰X = ((.rrr - .lll + 1) * Rnd() + .lll - ww) : 堏摦懱孮(IDX).尰嵼偺揰Y = ((.bbb - .ttt + 1) * Rnd() + .ttt - hh)
            End With
            '2018/09/04 add @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            If IsRectEmpty(rc撪敔) = 0 Then
                x1 = rc撪敔.lll - 堏摦懱暆 : x3 = rc撪敔.rrr
                y1 = rc撪敔.ttt - 堏摦懱崅 : y3 = rc撪敔.bbb
                If .尰嵼偺揰X > x1 And .尰嵼偺揰X < x3 And .尰嵼偺揰Y > y1 And .尰嵼偺揰Y < y3 Then
                    If Rnd() > 0.5 Then .尰嵼偺揰X = x1 Else .尰嵼偺揰X = x3
                    If Rnd() > 0.5 Then .尰嵼偺揰Y = y1 Else .尰嵼偺揰Y = y3
                    'qqqqq ".尰嵼偺揰X .尰嵼偺揰Y "
                End If
            End If
            '2018/09/04 add @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            '-------------------------------------------------------------------------
            .婳摴墌敿宎 = zz墌婳摴偺敿宎傪愝掕()
            僗僞乕僩儔僕傾儞 = (Rnd() * 堦廃儔僕傾儞)
            .婳摴墌拞怱X = .尰嵼偺揰X + (.婳摴墌敿宎 * System.Math.Cos(僗僞乕僩儔僕傾儞))
            .婳摴墌拞怱Y = .尰嵼偺揰Y - (.婳摴墌敿宎 * System.Math.Sin(僗僞乕僩儔僕傾儞))
            .尰嵼偺妏儔僕傾儞 = 僗僞乕僩儔僕傾儞 + (堦廃儔僕傾儞 / 2)
            '-------------------------------------------------------------------------
            '-------------------------------------------------------------------------
            bol = zz妏懍搙ABS_MinMax傪愝掕(.婳摴墌敿宎, .妏懍搙ABSmin, .妏懍搙ABSmax)
            .尰嵼偺妏懍搙 = IIf(Rnd() > 0.5, -1, 1) * (.妏懍搙ABSmin + Rnd(.妏懍搙ABSmax - .妏懍搙ABSmin))
            bol = zz尰嵼偺妏懍搙MinMaxCheck(堏摦懱孮(IDX))
            '-------------------------------------------------------------------------
            .婳摴妏懍搙憹尭棪 = zz妏懍搙偺憹尭棪(Rnd() > 0.5)
            .師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS = zz師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS傪愝掕(.婳摴墌敿宎)
            '-------------------------------------------------------------------------
            w尰嵼偺揰X = .尰嵼偺揰X
            w尰嵼偺揰Y = .尰嵼偺揰Y
        End With
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz師偺墌婳摴偲娭楢僨乕僞乕傪嶌惉(ByRef 堏摦懱 As 墌屖堏摦僇乕僪) As Boolean
        Dim p, n, 敿宎斾棪 As Single
        Dim 拞怱奜懁, bol As Boolean
        With 堏摦懱
            '-------------------------------------------------------------------------
            拞怱奜懁 = (Rnd() > 0.5)
            n = zz墌婳摴偺敿宎傪愝掕()
            敿宎斾棪 = .婳摴墌敿宎 / n
            '-------------------------------------------------------------------------
            If 拞怱奜懁 Then
                p = .婳摴墌敿宎 + n : .尰嵼偺妏懍搙 = -.尰嵼偺妏懍搙 * 敿宎斾棪
            Else
                p = .婳摴墌敿宎 - n : .尰嵼偺妏懍搙 = .尰嵼偺妏懍搙 * 敿宎斾棪
            End If
            '-------------------------------------------------------------------------
            .婳摴墌拞怱X = .婳摴墌拞怱X + (p * System.Math.Cos(.尰嵼偺妏儔僕傾儞))
            .婳摴墌拞怱Y = .婳摴墌拞怱Y - (p * System.Math.Sin(.尰嵼偺妏儔僕傾儞))
            .婳摴墌敿宎 = System.Math.Abs(n)
            .尰嵼偺妏儔僕傾儞 = IIf(拞怱奜懁, .尰嵼偺妏儔僕傾儞 + (堦廃儔僕傾儞 / 2), .尰嵼偺妏儔僕傾儞)
            '-------------------------------------------------------------------------
            bol = zz妏懍搙ABS_MinMax傪愝掕(.婳摴墌敿宎, .妏懍搙ABSmin, .妏懍搙ABSmax)
            bol = zz尰嵼偺妏懍搙MinMaxCheck(堏摦懱)
            '-------------------------------------------------------------------------
            .婳摴妏懍搙憹尭棪 = zz妏懍搙偺憹尭棪(.婳摴妏懍搙憹尭棪 < 0)
            .師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS = zz師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS傪愝掕(.婳摴墌敿宎)
            '-------------------------------------------------------------------------
        End With
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aaAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS() As Boolean
        Return zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS()
    End Function
    Private Function zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS() As Boolean
        Dim a As Integer
        For a = 1 To UBound(堏摦懱孮)
            堏摦懱孮(a).師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS = 0
        Next
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz妏懍搙ABS_MinMax傪愝掕(ByRef r婳摴墌敿宎 As Single, ByRef w妏懍搙ABSmin As Single, ByRef w妏懍搙ABSmax As Single) As Boolean
        w妏懍搙ABSmin = 0.6 / r婳摴墌敿宎 * p堏摦僗僺乕僪幚岠抣() * p堏摦僗僺乕僪CPU惈擻嵎偺曗惓幚岠抣()
        w妏懍搙ABSmax = w妏懍搙ABSmin * 3
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz墌婳摴偺敿宎傪愝掕(Optional ByRef 嵟彫敿宎Pxl As Single = 200) As Single
        Return p堏摦嬋慄偺敿宎幚岠抣() * (嵟彫敿宎Pxl + (Rnd() * 0.1 * (嘳Rect暆(rc堏摦斖埻) + 嘳Rect崅(rc堏摦斖埻))))
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz妏懍搙偺憹尭棪(ByRef 惓偺抣偵偡傞 As Boolean, Optional ByRef 嵟彫憹尭棪 As Single = 0.0001) As Single
        Dim n As Single
        n = 嵟彫憹尭棪 + (Rnd() * 0.04) '   n = 嵟彫憹尭棪 + (Rnd * 0.02)
        Return IIf(惓偺抣偵偡傞, n, -n)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS傪愝掕(ByRef r婳摴墌敿宎 As Single) As Single
        Return p堏摦嬋慄偺夞揮妏幚岠抣() * (0.8 + (Rnd() * 3.14)) * 100 / r婳摴墌敿宎
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz尰嵼偺妏懍搙MinMaxCheck(ByRef 堏摦懱 As 墌屖堏摦僇乕僪) As Boolean
        With 堏摦懱
            If .尰嵼偺妏懍搙 <= 0 And .尰嵼偺妏懍搙 > -.妏懍搙ABSmin Then .尰嵼偺妏懍搙 = -.妏懍搙ABSmin
            If .尰嵼偺妏懍搙 >= 0 And .尰嵼偺妏懍搙 < .妏懍搙ABSmin Then .尰嵼偺妏懍搙 = .妏懍搙ABSmin
            If .尰嵼偺妏懍搙 < -.妏懍搙ABSmax Then .尰嵼偺妏懍搙 = -.妏懍搙ABSmax
            If .尰嵼偺妏懍搙 > .妏懍搙ABSmax Then .尰嵼偺妏懍搙 = .妏懍搙ABSmax
        End With
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa尰嵼偺埵抲僨乕僞乕傪_X_曽岦偵偢傜偡(ByRef IDX As Integer, ByRef rShiftX As Single) As Boolean
        '2020/07/08 Form_Resize() 僀儀儞僩偐傜偩偗屇傃弌偟偰偄傞丅
        '娵嬍 / btn僗僞乕僩 偺僄儕傾偲丄慡僇乕僪偺偦傟偧傟偺 RECT 偺廳側傝傪僠僃僢僋偟偰丄廳側偭偰偄傞僇乕僪偼嫮惂堏摦偡傞丅
        With 堏摦懱孮(IDX)
            ret = OffsetRect(.rc堏摦懱, rShiftX, 0)
            .婳摴墌拞怱X = .婳摴墌拞怱X + rShiftX
            .尰嵼偺揰X = .尰嵼偺揰X + rShiftX
        End With
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa尰嵼偲慜夞偺埵抲僨乕僞乕(ByRef IDX As Integer, ByRef wNewX As Integer, ByRef wNewY As Integer, ByRef wOldX As Integer, ByRef wOldY As Integer, Optional ByRef wWD As Integer = 0, Optional ByRef wHT As Integer = 0, Optional ByRef 撪敔Left As Integer = 0, Optional ByRef 撪敔Top As Integer = 0, Optional ByRef 撪敔Width As Integer = 0, Optional ByRef 撪敔Height As Integer = 0) As Boolean
        Dim xxx, xx, yy, yyy As Single
        Dim ccc, LoopMax As Integer
        aa尰嵼偲慜夞偺埵抲僨乕僞乕 = False
        With 堏摦懱孮(IDX)
            xx = 嘳Rect暆(.rc堏摦懱) : xxx = 嘳Rect暆(rc堏摦斖埻) - xx
            yy = 嘳Rect崅(.rc堏摦懱) : yyy = 嘳Rect崅(rc堏摦斖埻) - yy
            ccc = 0
            LoopMax = 100
            '-------------------------------------------------------------------------
            If zz撪敔偲偺斀幩偑幚尰偟偨(堏摦懱孮(IDX), 撪敔Left, 撪敔Top, 撪敔Width, 撪敔Height) Then
                'OK    '2018/09/04 add @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            Else
                If .尰嵼偺揰X <= 0 Or .尰嵼偺揰X >= xxx Then
                    .婳摴墌拞怱Y = .婳摴墌拞怱Y + (2 * (.尰嵼偺揰Y - .婳摴墌拞怱Y))
                    .尰嵼偺妏儔僕傾儞 = 堦廃儔僕傾儞 - .尰嵼偺妏儔僕傾儞
                    Do
                        .尰嵼偺揰X = (.婳摴墌拞怱X + (.婳摴墌敿宎 * System.Math.Cos(.尰嵼偺妏儔僕傾儞)))
                        If .尰嵼偺揰X <= 0 Or .尰嵼偺揰X >= xxx Then
                            .尰嵼偺妏儔僕傾儞 = .尰嵼偺妏儔僕傾儞 + .尰嵼偺妏懍搙
                            ccc = ccc + 1
                            If ccc > LoopMax Then
                                '                        qqqqq "Loop Over X嵗昗" + CStr(LoopMax) + "  IDX=" + CStr(IDX) + ", .尰嵼偺揰X=" + Format(.尰嵼偺揰X, "#.#") + ", xxx=" + Format(xxx, "#.#") + ", .婳摴墌敿宎=" + Format(.婳摴墌敿宎, "#.#")
                                Exit Do
                            End If
                        Else
                            Exit Do
                        End If
                    Loop
                ElseIf .尰嵼偺揰Y <= 0 Or .尰嵼偺揰Y >= yyy Then
                    .婳摴墌拞怱X = .婳摴墌拞怱X + (2 * (.尰嵼偺揰X - .婳摴墌拞怱X))
                    .尰嵼偺妏儔僕傾儞 = (堦廃儔僕傾儞 * 1.5) - .尰嵼偺妏儔僕傾儞
                    Do
                        .尰嵼偺揰Y = (.婳摴墌拞怱Y - (.婳摴墌敿宎 * System.Math.Sin(.尰嵼偺妏儔僕傾儞)))
                        If .尰嵼偺揰Y <= 0 Or .尰嵼偺揰Y >= yyy Then
                            .尰嵼偺妏儔僕傾儞 = .尰嵼偺妏儔僕傾儞 + .尰嵼偺妏懍搙
                            ccc = ccc + 1
                            If ccc > LoopMax Then
                                '                        qqqqq "Loop Over Y嵗昗" + CStr(LoopMax) + "  IDX=" + CStr(IDX) + ", .尰嵼偺揰Y=" + Format(.尰嵼偺揰Y, "#.#") + ", yyy=" + Format(yyy, "#.#") + ", .婳摴墌敿宎=" + Format(.婳摴墌敿宎, "#.#")
                                Exit Do
                            End If
                        Else
                            Exit Do
                        End If
                    Loop
                End If
            End If
            '-------------------------------------------------------------------------
            If (.尰嵼偺揰X > 0 And .尰嵼偺揰Y > 0 And .尰嵼偺揰X < xxx And .尰嵼偺揰Y < yyy) Then
                .尰嵼偺妏懍搙 = .尰嵼偺妏懍搙 * (1 + .婳摴妏懍搙憹尭棪)
                bol = zz尰嵼偺妏懍搙MinMaxCheck(堏摦懱孮(IDX))
                .尰嵼偺妏儔僕傾儞 = .尰嵼偺妏儔僕傾儞 + .尰嵼偺妏懍搙
                wOldX = .尰嵼偺揰X
                wOldY = .尰嵼偺揰Y
                .尰嵼偺揰X = (.婳摴墌拞怱X + (.婳摴墌敿宎 * System.Math.Cos(.尰嵼偺妏儔僕傾儞)))
                .尰嵼偺揰Y = (.婳摴墌拞怱Y - (.婳摴墌敿宎 * System.Math.Sin(.尰嵼偺妏儔僕傾儞)))
                wNewX = .尰嵼偺揰X
                wNewY = .尰嵼偺揰Y
                wWD = xx
                wHT = yy
                .師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS = .師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS - System.Math.Abs(.尰嵼偺妏懍搙)
                If .師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS <= 0 Then
                    Return zz師偺墌婳摴偲娭楢僨乕僞乕傪嶌惉(堏摦懱孮(IDX))
                End If
                Return True
            End If
        End With
        Return False
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz撪敔偲偺斀幩偑幚尰偟偨(ByRef dd As 墌屖堏摦僇乕僪, ByRef 撪敔Left As Integer, ByRef 撪敔Top As Integer, ByRef 撪敔Width As Integer, ByRef 撪敔Height As Integer) As Boolean
        Dim RETBOL As Boolean
        Dim rcwww, NewX, OldX, OldY, NewY, rchhh As Single
        Dim y3, y1, x3, x1, x2, x4, y2, y4 As Single
        RETBOL = False
        x2 = 撪敔Left : x3 = 撪敔Left + 撪敔Width : y2 = 撪敔Top : y3 = 撪敔Top + 撪敔Height
        If (撪敔Width > 5) And (撪敔Height > 5) Then
            With dd
                rcwww = 嘳Rect暆(.rc堏摦懱) : rchhh = 嘳Rect崅(.rc堏摦懱)
                x1 = x2 - rcwww : x4 = x3 + rcwww : y1 = y2 - rchhh : y4 = y3 + rchhh
                OldX = .尰嵼偺揰X : NewX = (.婳摴墌拞怱X + (.婳摴墌敿宎 * System.Math.Cos(.尰嵼偺妏儔僕傾儞 + .尰嵼偺妏懍搙)))
                OldY = .尰嵼偺揰Y : NewY = (.婳摴墌拞怱Y - (.婳摴墌敿宎 * System.Math.Sin(.尰嵼偺妏儔僕傾儞 + .尰嵼偺妏懍搙)))
                If OldY >= y1 And NewY <= y3 Then
                    If (NewX <= x3 And OldX >= x3) Or (NewX >= x1 And OldX <= x1) Then '嫬奅傪挻偊傞帪揰偱偁傟偽
                        .婳摴墌拞怱Y = .婳摴墌拞怱Y + (2 * (.尰嵼偺揰Y - .婳摴墌拞怱Y))
                        .尰嵼偺妏儔僕傾儞 = 堦廃儔僕傾儞 - .尰嵼偺妏儔僕傾儞
                        .尰嵼偺揰X = (.婳摴墌拞怱X + (.婳摴墌敿宎 * System.Math.Cos(.尰嵼偺妏儔僕傾儞)))
                        RETBOL = True
                    End If
                End If
                If Not RETBOL Then
                    If OldX >= x1 And NewX <= x3 Then
                        If (NewY <= y3 And OldY >= y3) Or (NewY >= y1 And OldY <= y1) Then '嫬奅傪挻偊傞帪揰偱偁傟偽
                            .婳摴墌拞怱X = .婳摴墌拞怱X + (2 * (.尰嵼偺揰X - .婳摴墌拞怱X))
                            .尰嵼偺妏儔僕傾儞 = (堦廃儔僕傾儞 * 1.5) - .尰嵼偺妏儔僕傾儞
                            .尰嵼偺揰Y = (.婳摴墌拞怱Y - (.婳摴墌敿宎 * System.Math.Sin(.尰嵼偺妏儔僕傾儞)))
                            RETBOL = True
                        End If
                    End If
                End If
            End With
        End If
        '**********************************************************************************
        '2020/07/13 偙偺埵抲偼丄拞怱儃僞儞椞堟偲偺廳側傝僄儔乕偲偼柍娭學丅
        'If gFormReSize幚峴拞 And RETBOL Then qqqqq "zz撪敔偲偺斀幩偑幚尰偟偨() in FormResizw"
        '2020/07/13 偙偺埵抲偼丄拞怱儃僞儞椞堟偲偺廳側傝僄儔乕偲偼柍娭學丅
        '**********************************************************************************
        Return RETBOL
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa儕僒僀僘帪偺撪敔偲偺愙怗挷嵏偲堏摦(ByRef IDX As Integer, ByRef 撪敔RECT As RECT, ByRef wRGN杮懱 As Integer) As Boolean
        '2018/09/18 嶌惉   Nukenuke.cls  偵巊梡偡傞偨傔偵捛壛
        Dim rc堏摦懱尰嵼, rc As RECT
        Dim MoveX, xx, ww, hh, yy, MoveY As Single
        Dim X曽岦偵堏摦 As Boolean
        aa儕僒僀僘帪偺撪敔偲偺愙怗挷嵏偲堏摦 = False
        With 堏摦懱孮(IDX)
            ww = 嘳Rect暆(.rc堏摦懱) : hh = 嘳Rect崅(.rc堏摦懱)
            Call SetRect(rc堏摦懱尰嵼, .尰嵼偺揰X, .尰嵼偺揰Y, .尰嵼偺揰X + ww, .尰嵼偺揰Y + hh)
            If 0 <> IntersectRect(rc, 撪敔RECT, rc堏摦懱尰嵼) Then
                MoveX = 0 : MoveY = 0 : xx = 嘳Rect暆(rc) : yy = 嘳Rect崅(rc)
                X曽岦偵堏摦 = (yy >= xx)
                If X曽岦偵堏摦 Then
                    MoveX = xx + 3
                    If rc.lll = 撪敔RECT.lll Then MoveX = -MoveX
                Else
                    MoveY = yy + 3
                    If rc.ttt = 撪敔RECT.ttt Then MoveY = -MoveY
                End If
                .婳摴墌拞怱X = .婳摴墌拞怱X + MoveX
                .婳摴墌拞怱Y = .婳摴墌拞怱Y + MoveY
                .尰嵼偺揰X = .尰嵼偺揰X + MoveX
                .尰嵼偺揰Y = .尰嵼偺揰Y + MoveY
                Call OffsetRgn(wRGN杮懱, MoveX, MoveY)
                Return True
                'qqqqq "撪敔偲偺愙怗偁傝"
            End If
        End With
        Return False
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Public Sub New()
        MyBase.New()
        ReDim 堏摦懱孮(0)
        Call SetRect(rc堏摦斖埻, 0, 0, 0, 0)
        m堏摦幚峴拞 = False
        p僇乕僪僗僺乕僪攞悢 = 1.0#
    End Sub

    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Sub p僾儘僷_1to5_嫟梡_ListBox偵愝掕(ByRef box As ListBox, ByVal PropIndex As Integer)
        If box Is Nothing Then Return
        If PropIndex < 1 Or PropIndex > 6 Then Return
        Dim nnn As Integer = CInt(p僾儘僷_1to5_嫟梡_RW(PropIndex, gco僾儘僷Get))
        box.SelectedIndex = 嘳悢抣斖埻Int(0, box.Items.Count - 1, nnn - 1)  'listindex ( 0 - 4 )<---> property ( 1 - 5 )
    End Sub
    Friend Sub p僾儘僷_1to5_嫟梡_ListBox偐傜撉弌偟(ByRef box As ListBox, ByVal PropIndex As Integer)
        If box Is Nothing Then Return
        If PropIndex < 1 Or PropIndex > 6 Then Return
        Call p僾儘僷_1to5_嫟梡_RW(PropIndex, gco僾儘僷Let, CStr(嘳悢抣斖埻Int(0, box.Items.Count - 1, box.SelectedIndex + 1))) 'listindex ( 0 - 4 )<---> property ( 1 - 5 )
    End Sub
    Private Function p僾儘僷_1to5_嫟梡_RW(ByRef 僞僀僾 As Integer, ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", _
                            Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, _
                            Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        'index value mmm(x) = 1 to 5   list index = 0 to 4
        Static PropNames(10) As String
        PropNames(pp僇乕僪枃悢) = "pRandMode僇乕僪枃悢"  '1
        PropNames(pp僇乕僪僒僀僘) = "pRandMode僇乕僪僒僀僘"  '2
        PropNames(pp堏摦嬋慄偺夞揮妏) = "pRandMode堏摦嬋慄偺夞揮妏"  '3
        PropNames(pp堏摦嬋慄偺敿宎) = "pRandMode堏摦嬋慄偺敿宎"  '4
        PropNames(pp堏摦僗僺乕僪) = "pRandMode堏摦僗僺乕僪"  '5
        PropNames(pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓) = "pRandMode堏摦僗僺乕僪CPU惈擻嵎偺曗惓"  '6
        Static mmm(10) As Integer
        Dim n, 僒僀僘攞棪 As Single
        Dim www, a, Oldmmm, hhh As Integer
        Dim 僞僀僾safe As Integer = 嘳悢抣斖埻Int(1, 6, 僞僀僾)
        Oldmmm = mmm(僞僀僾safe)
        Dim RETSTR As String = CStr(Oldmmm)
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                If 僞僀僾safe = pp僇乕僪枃悢 Then
                    Return PropNames(pp僇乕僪枃悢)
                ElseIf 僞僀僾safe = pp僇乕僪僒僀僘 Then
                    Return PropNames(pp僇乕僪僒僀僘)
                ElseIf 僞僀僾safe = pp堏摦嬋慄偺夞揮妏 Then
                    Return PropNames(pp堏摦嬋慄偺夞揮妏)
                ElseIf 僞僀僾safe = pp堏摦嬋慄偺敿宎 Then
                    Return PropNames(pp堏摦嬋慄偺敿宎)
                ElseIf 僞僀僾safe = pp堏摦僗僺乕僪 Then
                    Return PropNames(pp堏摦僗僺乕僪)
                ElseIf 僞僀僾safe = pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓 Then
                    Return PropNames(pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓)
                End If
                Return "**** ERROR in RandMode.p僾儘僷_1to5_嫟梡_RW(gco僾儘僷柤)"
            Case gco僾儘僷弶婜壔
                mmm(僞僀僾safe) = 3
                Call zz儊僯儏乕憖嶌SetChecked10(mmm(僞僀僾safe), m1, m2, m3, m4, m5)
            Case gco僾儘僷婯掕抣
                Return CStr(3)
            Case gco僾儘僷Get
                RETSTR = CStr(mmm(僞僀僾safe))
            Case gco僾儘僷Let
                mmm(僞僀僾safe) = 嘳悢抣斖埻Int(1, 5, Val(s))
                Call zz儊僯儏乕憖嶌SetChecked10(mmm(僞僀僾safe), m1, m2, m3, m4, m5)
            Case gco僾儘僷iniWR
                RETSTR = 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropNames(僞僀僾safe), CStr(mmm(僞僀僾safe)))
            Case gco僾儘僷iniRD
                mmm(僞僀僾safe) = 嘳悢抣斖埻Int(1, 5, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropNames(僞僀僾safe), s)))
                Call zz儊僯儏乕憖嶌SetChecked10(mmm(僞僀僾safe), m1, m2, m3, m4, m5)
            Case gco僾儘僷MenuClick
                mmm(僞僀僾safe) = 嘳悢抣斖埻Int(1, 5, Val(s)) : Call zz儊僯儏乕憖嶌SetChecked10(mmm(僞僀僾safe), m1, m2, m3, m4, m5)
            Case gco僾儘僷幚岠抣
                a = CDbl(嘳悢抣斖埻Int(1, 5, mmm(僞僀僾safe)))
                If 僞僀僾safe = pp僇乕僪枃悢 Then
                    n = CSng(Choose(a, 50, 100, 200, 300, 400))
                ElseIf 僞僀僾safe = pp僇乕僪僒僀僘 Then
                    n = CSng(Choose(a, 0.7, 0.88, 1.0#, 1.2, 1.5))
                ElseIf 僞僀僾safe = pp堏摦嬋慄偺夞揮妏 Then
                    n = CSng(Choose(a, 0.5, 0.7, 1.0#, 1.4, 2.0#))
                ElseIf 僞僀僾safe = pp堏摦嬋慄偺敿宎 Then
                    n = CSng(Choose(a, 0.25, 0.5, 1.0#, 2, 4.0#)) '    n = CSng(Choose(a, 0.5, 0.7, 1#, 1.4, 2#))
                ElseIf 僞僀僾safe = pp堏摦僗僺乕僪 Then
                    n = CSng(Choose(a, 0.5, 0.7, 1.0#, 1.4, 2.0#)) * p僇乕僪僗僺乕僪攞悢
                ElseIf 僞僀僾safe = pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓 Then
                    n = CSng(Choose(a, 0.25, 0.5, 1.0#, 2, 4.0#))
                End If
                RETSTR = CStr(n)

        End Select
        '儕傾儖僞僀儉偱堏摦儌乕僪傪曄峏偝偣傞偨傔
        If m堏摦幚峴拞 = True Then
            If Oldmmm <> mmm(僞僀僾safe) And (僾儘僷僐儅儞僪 = gco僾儘僷Let Or 僾儘僷僐儅儞僪 = gco僾儘僷MenuClick) Then
                If 僞僀僾safe = pp僇乕僪枃悢 Then
                    m堏摦幚峴拞偺僇乕僪枃悢曄峏 = True
                ElseIf 僞僀僾safe = pp僇乕僪僒僀僘 Then
                    僒僀僘攞棪 = p僎乕儉僇乕僪偺僒僀僘幚岠抣() / mOld僇乕僪僒僀僘幚岠抣
                    www = 嘳Rect暆(rc堏摦斖埻) : hhh = 嘳Rect崅(rc堏摦斖埻)
                    For a = 1 To UBound(堏摦懱孮)
                        bol = zz堏摦懱RECT偺僒僀僘曄峏偲婳摴墌拞怱XY偺堏摦挷惍(堏摦懱孮(a), 僒僀僘攞棪, 僒僀僘攞棪, www, hhh)
                    Next
                    mOld僇乕僪僒僀僘幚岠抣 = p僎乕儉僇乕僪偺僒僀僘幚岠抣()
                    bol = zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS()
                ElseIf 僞僀僾safe = pp堏摦嬋慄偺夞揮妏 Then
                    bol = zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS()
                ElseIf 僞僀僾safe = pp堏摦嬋慄偺敿宎 Then
                    bol = zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS()
                ElseIf 僞僀僾safe = pp堏摦僗僺乕僪 Then
                    bol = zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS()
                ElseIf 僞僀僾safe = pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓 Then
                    bol = zzAll_Set0_師偺婳摴拞怱曄峏傑偱偺妏儔僕傾儞ABS()
                End If
            End If
        End If
        Return RETSTR
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p僇乕僪枃悢幚岠抣() As Integer
        Return Val(p僇乕僪枃悢_RW(gco僾儘僷幚岠抣))
    End Function
    Friend Function p僇乕僪枃悢_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        Return p僾儘僷_1to5_嫟梡_RW(pp僇乕僪枃悢, 僾儘僷僐儅儞僪, s, m1, m2, m3, m4, m5)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p僎乕儉僇乕僪偺僒僀僘幚岠抣() As Single
        Return Val(p僎乕儉僇乕僪偺僒僀僘_RW(gco僾儘僷幚岠抣))
    End Function
    Friend Function p僎乕儉僇乕僪偺僒僀僘_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        Return p僾儘僷_1to5_嫟梡_RW(pp僇乕僪僒僀僘, 僾儘僷僐儅儞僪, s, m1, m2, m3, m4, m5)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p堏摦嬋慄偺夞揮妏幚岠抣() As Single
        Return Val(p堏摦嬋慄偺夞揮妏_RW(gco僾儘僷幚岠抣))
    End Function
    Friend Function p堏摦嬋慄偺夞揮妏_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        Return p僾儘僷_1to5_嫟梡_RW(pp堏摦嬋慄偺夞揮妏, 僾儘僷僐儅儞僪, s, m1, m2, m3, m4, m5)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p堏摦嬋慄偺敿宎幚岠抣() As Single
        Return Val(p堏摦嬋慄偺敿宎_RW(gco僾儘僷幚岠抣))
    End Function
    Friend Function p堏摦嬋慄偺敿宎_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        Return p僾儘僷_1to5_嫟梡_RW(pp堏摦嬋慄偺敿宎, 僾儘僷僐儅儞僪, s, m1, m2, m3, m4, m5)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p堏摦僗僺乕僪幚岠抣() As Single
        Return Val(p堏摦僗僺乕僪_RW(gco僾儘僷幚岠抣))
    End Function
    Friend Function p堏摦僗僺乕僪_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        Return p僾儘僷_1to5_嫟梡_RW(pp堏摦僗僺乕僪, 僾儘僷僐儅儞僪, s, m1, m2, m3, m4, m5)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p堏摦僗僺乕僪CPU惈擻嵎偺曗惓幚岠抣() As Single
        Return Val(p堏摦僗僺乕僪CPU惈擻嵎偺曗惓_RW(gco僾儘僷幚岠抣))
    End Function
    Friend Function p堏摦僗僺乕僪CPU惈擻嵎偺曗惓_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef m1 As ToolStripMenuItem = Nothing, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing) As String
        Return p僾儘僷_1to5_嫟梡_RW(pp堏摦僗僺乕僪CPU惈擻嵎偺曗惓, 僾儘僷僐儅儞僪, s, m1, m2, m3, m4, m5)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Function zz儊僯儏乕憖嶌SetChecked10(ByRef chkIDX As Integer, ByRef m1 As ToolStripMenuItem, Optional ByRef m2 As ToolStripMenuItem = Nothing, Optional ByRef m3 As ToolStripMenuItem = Nothing, _
                        Optional ByRef m4 As ToolStripMenuItem = Nothing, Optional ByRef m5 As ToolStripMenuItem = Nothing, Optional ByRef m6 As ToolStripMenuItem = Nothing, _
                        Optional ByRef m7 As ToolStripMenuItem = Nothing, Optional ByRef m8 As ToolStripMenuItem = Nothing, Optional ByRef m9 As ToolStripMenuItem = Nothing, Optional ByRef m10 As ToolStripMenuItem = Nothing) As Boolean
        If m1 Is Nothing Then Return False
        m1.Checked = (chkIDX = 1)
        If m2 Is Nothing Then Return True
        m2.Checked = (chkIDX = 2)
        If m3 Is Nothing Then Return True
        m3.Checked = (chkIDX = 3)
        If m4 Is Nothing Then Return True
        m4.Checked = (chkIDX = 4)
        If m5 Is Nothing Then Return True
        m5.Checked = (chkIDX = 5)
        If m6 Is Nothing Then Return True
        m6.Checked = (chkIDX = 6)
        If m7 Is Nothing Then Return True
        m7.Checked = (chkIDX = 7)
        If m8 Is Nothing Then Return True
        m8.Checked = (chkIDX = 8)
        If m9 Is Nothing Then Return True
        m9.Checked = (chkIDX = 9)
        If m10 Is Nothing Then Return True
        m10.Checked = (chkIDX = 10)
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    'Friend Function aatest堏摦懱億僀儞僩偡傋偰昤夋(f As Form, Optional rColor As Long = 0)
    '    Dim a As Long, hDC As Long
    '    hDC = f.hDC
    '    For a = 1 To UBound(堏摦懱孮())
    '        With 堏摦懱孮(a)
    '            ret = Rectangle(hDC, CLng(.尰嵼偺揰X), CLng(.尰嵼偺揰Y), CLng(.尰嵼偺揰X) + 3, CLng(.尰嵼偺揰Y) + 3)
    '            f.Circle (.婳摴墌拞怱X, .婳摴墌拞怱Y), .婳摴墌敿宎
    '        End With
    '    Next
    'End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    'Function 妏儔僕傾儞偺堦廃埲壓偺抣(妏儔僕傾儞 As Single, 堦廃僷僀 As Single) As Single
    '    Dim n As Single
    '    n = 妏儔僕傾儞
    '    Do While n > 堦廃僷僀
    '        n = n - 堦廃僷僀
    '    Loop
    '    妏儔僕傾儞偺堦廃埲壓偺抣 = n
    'End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    '
#End Region

End Class