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

#Region "愰尵"
    Public WithEvents 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg As 巐frmDlgUseCardSelect
    Public WithEvents 僇乕僪僔儑乕僆僾僔儑儞Dlg As frmDlg僇乕僪僔儑乕僆僾僔儑儞

    Private mDoEventsCall As Boolean = False
    Private Const 惎 As String = "仛"
    '僇乕僪僔儑乕偺僞僀僾
    Private Const c僇乕僪僔儑乕僘乕儉 As Short = 1
    Private Const c僇乕僪僔儑乕僕儍儞僾 As Short = 2
    Private Const c僇乕僪僔儑乕僗儔僀僪 As Short = 3
    Private Const c僇乕僪僔儑乕僋儖僋儖 As Short = 4
    Private Const c僇乕僪僔儑乕僗僩僢僾 As Short = 5
    Private Const c僇乕僪僔儑乕傾僠僐僠 As Short = 6
    Private Const c僇乕僪僔儑乕儁僞儁僞 As Short = 7
    Private Const c僇乕僪僔儑乕僗僋僗僋 As Short = 8
    Private Const c僇乕僪僔儑乕僼儔僼儔 As Short = 9
    '僇乕僪僔儑乕偵巊梡偡傞柾條偺僞僀僾丅
    Private Const c僇乕僪僔儑乕慡夋憸 As Short = 3
    Private Const c僇乕僪僔儑乕慡柾條 As Short = 2
    Private Const c僇乕僪僔儑乕暥帤 As Short = 1
    Private Const c僇乕僪僔儑乕夋憸柾條暥帤 As Short = 0
    '********************************************************************************
    Private mm儁儞崟 As Integer = 0
    '**************************************************************************************************************************************
    Private WithEvents 僀儀儞僩gAppEventMaker As 屲clsEventMaker
    '**************************************************************************************************************************************
#End Region

#Region "New ....Finalize"
    Public Sub New()
        MyBase.New()
        mm儁儞崟 = CreatePen(PS_SOLID, 1, System.Drawing.ColorTranslator.ToWin32(System.Drawing.Color.Black))
        僀儀儞僩gAppEventMaker = gAppEventMaker
    End Sub
    Protected Overrides Sub Finalize()
        If mm儁儞崟 <> 0 Then gggint = DeleteObject(mm儁儞崟)
        mm儁儞崟 = 0
        MyBase.Finalize()
    End Sub
#End Region

#Region "儊僀儞僐乕僪"
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa僇乕僪僔儑乕奐巒偲掆巭(ByRef r僇乕僪僔儑乕儌乕僪 As Integer) As Boolean
        '********************************************************************************
        If mDoEventsCall Then
            qqqqq("mDoEventsCall") : Exit Function
        End If
        If gm傾僾儕廔椆偡傞 Then Exit Function
        If pp僗僀僗僀僼儔僼儔_偄偢傟偐偁傞偄偼椉曽_傪幚峴拞 Then Exit Function
        '********************************************************************************
        Dim 偙偺娭悢偺嵟弶偺擖岥 As Boolean
        Dim o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢 As Integer = p僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢
        Dim o僇乕僪偺堏摦僗僥僢僾悢Value, o儌乕僪偛偲偺弌尰夞悢Value As Integer
        Dim cur僔儑乕僇乕僪僀儊乕僕OnStart, cur僔儑乕僇乕僪僀儊乕僕, cur僔儑乕僇乕僪僀儊乕僕OLD, cur僇乕僪僔儑乕儌乕僪OLD, cur僇乕僪僒僀僘戝拞彫OLD As Integer
        Dim o偡傋偰偺僇乕僪宆傪巊梡偡傞 As Boolean
        Dim vv怴偟偄攚宨夋憸傪僙僢僩偡傞 As Boolean
        Dim vvfrmMainClientSizeWidthCUR, vvfrmMainClientSizeHeightCUR As Integer
        '********************************************************************************
        Dim m僼僅乕儉慡椞堟copy, m僇乕僪孮椞堟copy As RECT
        Dim m僼僅乕儉慡椞堟暆, m僼僅乕儉慡椞堟崅 As Integer
        Dim mMoveData(1, o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢) As RECT
        Dim mMoveDataJmpDef(o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢) As RECT
        Dim CardWDwnd, CardHTwnd, CardWDwndmax, CardHTwndmax As Integer
        Dim 儌乕僪偺夞悢, 儌乕僪偺夞悢椵寁, 摨堦儌乕僪偱偺弌尰夞悢 As Integer
        '****************************************************************************************************************************************************************
        ''2018/07/16  僇乕僪宆偺巊梡偺偨傔偺僥僗僩僐乕僪
        Dim 僇乕僪宆斣崋 As Integer = -10 : Dim 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝 As Integer
        '****************************************************************************************************************************************************************
        Dim a, b, c As Integer
        Dim ddd, xx1, yy1, px, ccc, CTY, CTX, CTYJP As Single
        Dim tmprect As RECT
        '****************************************************************************************************************************************************************
        Dim 榞暆幚悺梡偺攞悢, 摿暿側攞悢 As Single
        Dim Brush巐杮(4), Brsh慄 As Integer
        '****************************************************************************************************************************************************************
        '--------------------------------------------------------------------------------
        儌乕僪偺夞悢椵寁 = 0
        If r僇乕僪僔儑乕儌乕僪 = 0 Then '暋悢儌乕僪丂幚峴奐巒
            gm僇乕僪僔儑乕暋悢儌乕僪 = True
            儌乕僪偺夞悢 = c僇乕僪僔儑乕僼儔僼儔 '9
        Else '扨堦丂儌乕僪丂幚峴
            gm僇乕僪僔儑乕暋悢儌乕僪 = False
            p僇乕僪僔儑乕儌乕僪 = r僇乕僪僔儑乕儌乕僪
            儌乕僪偺夞悢 = 1
        End If
        偙偺娭悢偺嵟弶偺擖岥 = True
        pp僇乕僪僔儑乕幚峴拞 = True
        cur僔儑乕僇乕僪僀儊乕僕OnStart = 759638
        '--------------------------------------------------------------------------------
        Dim 夋暆 As Integer = 400
        Dim 夋崅 As Integer = 400
        Dim 尰嵼偺僇乕僪BMPOBJ As Bitmap = New Bitmap(frmMain.pct嶌嬈梡.Image, 夋暆 * 3, 夋崅 * 1.5)
        Dim 尰嵼偺僇乕僪BMP As Integer = 尰嵼偺僇乕僪BMPOBJ.GetHbitmap
        尰嵼偺僇乕僪BMPOBJ.Dispose()
        '--------------------------------------------------------------------------------
        With frmMain
            If .pctCard00.Visible Then
                .pctCard00.Visible = False : .pctCard01.Visible = False
            End If
        End With
        '--------------------------------------------------------------------------------
        gggbol = 僀儀儞僩gAppEventMaker.MakeEvent僇乕僪僔儑乕奐巒偲掆巭(True)
        gggbol = gm傾僾儕屌桳僋儔僗.aa僗僀僗僀_僔儑乕僇乕僪_僀儊乕僕憖嶌(100, p僔儑乕僇乕僪僀儊乕僕, False, 0, 0, 0, 0, Brush巐杮, 0, 0, 0, 0, 0, 0, 0) 'Make bitmap image   柾條丂乛丂僇僫暥帤丂乛丂夋憸
        For a = 1 To 4
            If Brush巐杮(a) <> 0 Then gggint = DeleteObject(Brush巐杮(a))
            Brush巐杮(a) = CreateSolidBrush(IIf(a = 1, 嘳Color峔憿懱_to_怓抣(frmMain.BackColor), IIf(a = 2, 嘳Color峔憿懱_to_怓抣(System.Drawing.Color.White), IIf(a = 3, gm傾僾儕屌桳僋儔僗.p僎乕儉攝怓傂傜偑側, gm傾僾儕屌桳僋儔僗.p僎乕儉攝怓僇僞僇僫))))
        Next
        gggbol = gm傾僾儕屌桳僋儔僗.aa僗僀僗僀_僔儑乕僇乕僪_僀儊乕僕憖嶌(200, p僔儑乕僇乕僪僀儊乕僕, False, 0, 0, 0, 0, Brush巐杮, 0, 0, 0, 0, 0, 0, 0) '尰嵼偺柾條偲夋憸僀儞僨僢僋僗傪儕僙僢僩
        '--------------------------------------------------------------------------------
        gggbol = zz攚宨夋憸偺憖嶌(1, 0, frmMain)
        vvfrmMainClientSizeWidthCUR = frmMain.ClientSize.Width : vvfrmMainClientSizeHeightCUR = frmMain.ClientSize.Height
        '*************************************************************************************************************************************************************************************
        gm僇乕僪儖乕僾掆巭尨場 = 555
        摨堦儌乕僪偱偺弌尰夞悢 = 0
        儌乕僪偺夞悢椵寁 = 1
        '*************************************************************************************************************************************************************************************
ChgNewChar:  '僇乕僪偺暥帤曄峏偱怴偟偔僕儍儞僾僘乕儉偺侾僒僀僋儖傪奐巒
        '************************************************
        vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = False
        '************************************************
        '廳梫丂僂僀儞僪僂偑傾僀僐儞壔偝傟偰偄傞偲偒偼丄偙偺儖乕僾偺張棟偼拞抐偡傞丅
        With frmMain
            Do While .WindowState = System.Windows.Forms.FormWindowState.Minimized
                Call Sleep(500)
                'qqqqq("mDoEventsCall = True  傾僀僐儞壔")
                mDoEventsCall = True : System.Windows.Forms.Application.DoEvents() : mDoEventsCall = False
                If gm傾僾儕廔椆偡傞 Then
                    GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction
                ElseIf .WindowState <> System.Windows.Forms.FormWindowState.Minimized Then
                    vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = True
                    Exit Do
                End If
            Loop
        End With
        '************************************************
        If 偙偺娭悢偺嵟弶偺擖岥 = True Then
            偙偺娭悢偺嵟弶偺擖岥 = False
            If gm僇乕僪僔儑乕暋悢儌乕僪 = True Then  '僇乕僪僔儑乕幚峴暋悢偺崿崌
                p僇乕僪僔儑乕儌乕僪 = p僇乕僪僔儑乕儌乕僪_僇乕僪僞僀僾_GET(1)   '嵟弶偺幚峴僔儑乕僞僀僾傪僙僢僩偡傞
                儌乕僪偺夞悢椵寁 = 1
            Else   '摿掕偺扨堦儌乕僪
                儌乕僪偺夞悢椵寁 = 1
            End If
            vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = True
        ElseIf 摨堦儌乕僪偱偺弌尰夞悢 = 0 Then            '師偺僇乕僪僔儑乕儌乕僪傪僙僢僩偡傞
            If gm僇乕僪僔儑乕暋悢儌乕僪 = True Then
                p僇乕僪僔儑乕儌乕僪 = p僇乕僪僔儑乕儌乕僪_僇乕僪僞僀僾_GET(2)
                儌乕僪偺夞悢椵寁 = 儌乕僪偺夞悢椵寁 + 1
            Else
                儌乕僪偺夞悢椵寁 = 1
            End If
            vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾
        End If
        '************************************************
        With frmMain
            If gm僇乕僪儖乕僾掆巭尨場 = 555 Then
                Dim wwww, hhhh As Integer
                vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = True
                '僇乕僪堏摦帪偵僼僅乕儉偐傜旘傃弌偟偰偟傑偭偨偐傪僠僃僢僋偡傞 w僼僅乕儉慡椞堟 傪嶌傞丅
                With frmMain : ccc = .mMenuHight : wwww = .ClientSize.Width : hhhh = .ClientSize.Height : End With
                With m僼僅乕儉慡椞堟copy : .lll = 0 : .ttt = ccc : .rrr = wwww : .bbb = hhhh : End With
                '僇乕僪孮椞堟傪揔惓側僒僀僘偵偡傞
                With m僇乕僪孮椞堟copy
                    a = Math.Min(wwww, hhhh) \ 60
                    .lll = a : .ttt = ccc + a : .rrr = wwww - a : .bbb = hhhh - a
                    Dim scrnWidth, scrnHight As Integer
                    gggbol = 嘳GetScreenSizeNET(tmprect, scrnWidth, scrnHight, 0, 0, 0, 0)
                    .lll = 嘳悢抣斖埻Int(0, scrnWidth - app僇乕僪孮椞堟嵟彫僒僀僘, .lll)
                    .ttt = 嘳悢抣斖埻Int(ccc, scrnHight - app僇乕僪孮椞堟嵟彫僒僀僘, .ttt)
                    If 嘳Rect暆(m僇乕僪孮椞堟copy) < app僇乕僪孮椞堟嵟彫僒僀僘 Then .rrr = .lll + app僇乕僪孮椞堟嵟彫僒僀僘
                    If 嘳Rect崅(m僇乕僪孮椞堟copy) < app僇乕僪孮椞堟嵟彫僒僀僘 Then .bbb = .ttt + app僇乕僪孮椞堟嵟彫僒僀僘
                End With

            End If
            '--------------------------------------------------------------------------------
            '0  夋憸丄柾條丄暥帤
            '1  暥帤偩偗
            '2  傕傛偆偩偗
            '3  夋憸偩偗     
            If p僔儑乕僇乕僪僀儊乕僕 = c僇乕僪僔儑乕夋憸柾條暥帤 Then
                If cur僔儑乕僇乕僪僀儊乕僕OnStart = 759638 Then
                    cur僔儑乕僇乕僪僀儊乕僕OnStart = 0
                    cur僔儑乕僇乕僪僀儊乕僕 = 1
                Else
                    cur僔儑乕僇乕僪僀儊乕僕 = cur僔儑乕僇乕僪僀儊乕僕 + 1
                    If cur僔儑乕僇乕僪僀儊乕僕 > 3 Then cur僔儑乕僇乕僪僀儊乕僕 = 1
                End If
            Else
                cur僔儑乕僇乕僪僀儊乕僕 = p僔儑乕僇乕僪僀儊乕僕
            End If
            o僇乕僪偺堏摦僗僥僢僾悢Value = p僇乕僪偺堏摦僗僥僢僾悢Value
            o儌乕僪偛偲偺弌尰夞悢Value = p儌乕僪偛偲偺弌尰夞悢Value
            o偡傋偰偺僇乕僪宆傪巊梡偡傞 = p偡傋偰偺僇乕僪宆傪巊梡偡傞
        End With
        '--------------------------------------------------------------------------------
        摨堦儌乕僪偱偺弌尰夞悢 = 摨堦儌乕僪偱偺弌尰夞悢 + 1
        '--------------------------------------------------------------------------------
        '弶婜壔  pctBmp 偵僐僺乕尦偺僇乕僪傪嶌偭偰偍偔丅
        If (摨堦儌乕僪偱偺弌尰夞悢 = 1) Or (gm僇乕僪儖乕僾掆巭尨場 = 555) Or (cur僔儑乕僇乕僪僀儊乕僕OLD <> cur僔儑乕僇乕僪僀儊乕僕) Or (cur僇乕僪僒僀僘戝拞彫OLD <> p僇乕僪僒僀僘戝拞彫) Or (cur僇乕僪僔儑乕儌乕僪OLD <> p僇乕僪僔儑乕儌乕僪) Then
            '僒僀僘偺婎弨抣傪愝掕偡傞丅
            '揮憲傕偲偺儊儌儕僀儊乕僕僒僀僘傪嶌偭偰偍偔
            m僼僅乕儉慡椞堟暆 = 嘳Rect暆(m僼僅乕儉慡椞堟copy)
            m僼僅乕儉慡椞堟崅 = 嘳Rect崅(m僼僅乕儉慡椞堟copy)
            Dim CardWDmem As Integer = m僼僅乕儉慡椞堟暆 / 3
            Dim CardHTmem As Integer = m僼僅乕儉慡椞堟崅 / 3
            If cur僔儑乕僇乕僪僀儊乕僕 = c僇乕僪僔儑乕暥帤 Then
                c = (CardWDmem + CardHTmem) \ 2
                CardWDmem = c : CardHTmem = c
            End If
            CTX = m僼僅乕儉慡椞堟暆 / 2 : CTY = m僼僅乕儉慡椞堟崅 / 2
            '--------------------------------------------------------------------------------
            Dim 僘乕儉斾 As Single
            Select Case p僇乕僪僒僀僘戝拞彫
                Case 1 : 僘乕儉斾 = 0.5
                Case 2 : 僘乕儉斾 = 0.75
                Case 3 : 僘乕儉斾 = 1.0#
                Case 4 : 僘乕儉斾 = 1.25
                Case 5 : 僘乕儉斾 = 1.5
                Case Else : 僘乕儉斾 = 1.0#
            End Select
            CardWDwnd = CardWDmem * 僘乕儉斾 * 0.3 : CardHTwnd = CardHTmem * 僘乕儉斾 * 0.3
            '--------------------------------------------------------------------------------
            '僔儑乕僇乕僪僘乕儉帪偺嵟戝僒僀僘偺婎弨抣傪 m僼僅乕儉慡椞堟copy 僒僀僘偵斾椺偟偰愝掕偡傞丅
            Select Case p僇乕僪僔儑乕儌乕僪
                Case c僇乕僪僔儑乕僘乕儉 : c = 5
                Case c僇乕僪僔儑乕僕儍儞僾 : c = 4
                Case c僇乕僪僔儑乕僗儔僀僪 : c = 4
                Case c僇乕僪僔儑乕僋儖僋儖 : c = 4
                Case c僇乕僪僔儑乕僗僩僢僾 : c = 3
                Case c僇乕僪僔儑乕傾僠僐僠 : c = 4
                Case c僇乕僪僔儑乕儁僞儁僞 : c = 4
                Case c僇乕僪僔儑乕僗僋僗僋 : c = 3
                Case c僇乕僪僔儑乕僼儔僼儔 : c = 4
                Case Else : c = 4
            End Select
            CardWDwndmax = 嘳Rect暆(m僼僅乕儉慡椞堟copy) / c : CardHTwndmax = 嘳Rect崅(m僼僅乕儉慡椞堟copy) / c
            '--------------------------------------------------------------------------------
            Select Case p僇乕僪僔儑乕儌乕僪
                Case c僇乕僪僔儑乕僘乕儉
                    CardWDwndmax = CardWDwndmax * 僘乕儉斾 : CardHTwndmax = CardHTwndmax * 僘乕儉斾
                    '僕儍儞僾僔儑乕偺僨乕僞乕偺婎杮攝楍傪嶌偭偰偍偔
                Case c僇乕僪僔儑乕僕儍儞僾
                    CTYJP = m僼僅乕儉慡椞堟崅 * 0.85
                    px = 3.0# / o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢
                    xx1 = m僼僅乕儉慡椞堟暆 / 2
                    yy1 = m僼僅乕儉慡椞堟崅
                    For a = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢
                        b = a - 1
                        ccc = b * px
                        ddd = (((ccc - 1) * (ccc - 1)) - 1)
                        mMoveDataJmpDef(a).lll = ccc * xx1
                        mMoveDataJmpDef(a).ttt = ddd * yy1
                    Next
            End Select
        End If
        '--------------------------------------------------------------------------------
        gm僇乕僪儖乕僾掆巭尨場 = 0
        cur僔儑乕僇乕僪僀儊乕僕OLD = cur僔儑乕僇乕僪僀儊乕僕
        cur僇乕僪僒僀僘戝拞彫OLD = p僇乕僪僒僀僘戝拞彫
        cur僇乕僪僔儑乕儌乕僪OLD = p僇乕僪僔儑乕儌乕僪
        '--------------------------------------------------------------------------------
        'qqqqq(CStr(p僇乕僪僔儑乕儌乕僪))
        '--------------------------------------------------------------------------------
        Dim 惓曽宍偵偡傞 As Boolean
        '0  夋憸丄柾條丄暥帤
        '1  暥帤偩偗
        '2  傕傛偆偩偗
        '3  夋憸偩偗     
        Select Case cur僔儑乕僇乕僪僀儊乕僕
            Case 0 '
                'non op
            Case 1, 2
                惓曽宍偵偡傞 = True
            Case Else
                惓曽宍偵偡傞 = False
        End Select
        '*************************************************************************************************************************************************************************************
        Dim 奜榞暆幚悺, 榞暆幚悺 As Integer
        Dim Rgn夋 As Integer = 0 : Dim Rgn榞 As Integer = 0
        gggbol = gm傾僾儕屌桳僋儔僗.aa僗僀僗僀_僔儑乕僇乕僪_僀儊乕僕憖嶌(300, cur僔儑乕僇乕僪僀儊乕僕, 惓曽宍偵偡傞, 榞暆幚悺梡偺攞悢, 摿暿側攞悢, 摨堦儌乕僪偱偺弌尰夞悢, Brsh慄, Brush巐杮, 0, 0, 0, 0, 0, 0, 0)
        gggbol = gm傾僾儕屌桳僋儔僗.aa僗僀僗僀_僔儑乕僇乕僪_僀儊乕僕憖嶌(350, cur僔儑乕僇乕僪僀儊乕僕, 惓曽宍偵偡傞, 0, 0, 0, 0, Brush巐杮, 奜榞暆幚悺, 榞暆幚悺, 夋暆, 夋崅, Rgn夋, Rgn榞, 0)
        gggbol = gm傾僾儕屌桳僋儔僗.aa僗僀僗僀_僔儑乕僇乕僪_僀儊乕僕憖嶌(500, cur僔儑乕僇乕僪僀儊乕僕, 惓曽宍偵偡傞, 0, 0, 0, 0, Brush巐杮, 奜榞暆幚悺, 榞暆幚悺, 0, 0, Rgn夋, Rgn榞, 尰嵼偺僇乕僪BMP)
        '--------------------------------------------------------------------------------
        If Rgn夋 = 0 Then GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction
        '--------------------------------------------------------------------------------
        gggint = GetRgnBox(Rgn夋, tmprect)
        If Rgn夋 <> 0 Then gggint = DeleteObject(Rgn夋)
        If Rgn榞 <> 0 Then gggint = DeleteObject(Rgn榞)
        Rgn夋 = 0
        Rgn榞 = 0
        Dim Bit揮憲尦WD As Integer = 嘳Rect暆(tmprect)
        Dim Bit揮憲尦HT As Integer = 嘳Rect崅(tmprect)
        '--------------------------------------------------------------------------------
        If o偡傋偰偺僇乕僪宆傪巊梡偡傞 Then
            Dim 儕乕僕儑儞夋憸 As Integer = 0
            Dim 儕乕僕儑儞敀榞 As Integer = 0
            Dim 僼儗乕儉儔僀儞暆 As Integer = 1
            Dim 僇乕僪宆攞悢 As Single = 1.0#
            '--------------------------------------------------------------------------------
            僇乕僪宆斣崋 = p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_NextSet()
            '--------------------------------------------------------------------------------
            If gm傾僾儕屌桳僋儔僗.aa僎乕儉僇乕僪宆儕乕僕儑儞傪嶌傞(False, 僇乕僪宆斣崋, Bit揮憲尦WD, Bit揮憲尦HT, 儕乕僕儑儞夋憸, 儕乕僕儑儞敀榞, 僇乕僪宆攞悢, 僼儗乕儉儔僀儞暆, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝) Then
                If 儕乕僕儑儞夋憸 <> 0 Then
                    Dim OKOKOK As Boolean = False
                    Dim bmptmp As Integer, oldbmp0 As Integer
                    oldbmp0 = SelectObject(ghDC2, 尰嵼偺僇乕僪BMP)
                    If oldbmp0 <> 0 Then
                        bmptmp = 嘳BmpMakeMaskBackColorSet(ghDC2, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝)
                        gggint = SelectObject(ghDC2, oldbmp0)
                        oldbmp0 = 0
                        If bmptmp <> 0 Then
                            '--------------------------------------------------------------------------------
                            'p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢() 偑 1.0 埲奜偺応崌偼 ( 0.6 乣 1.5 )丄儅僗僋夋憸偑僌儗乕偵側傜側偄傛偆偵丄偙偺弴彉埵抲偱丄( 尰嵼偺僇乕僪BMP ) 偩偗傪柧搙曄姺偡傞丅
                            If p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢() <> 1.0 Then
                                Dim img As Image = Image.FromHbitmap(尰嵼偺僇乕僪BMP)
                                If img IsNot Nothing Then
                                    Dim bm As Bitmap = img.Clone
                                    If 嘳BmpPctBox柧傞偔埫偔偡傞_BitsByteAry(bm, p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢) Then
                                        DeleteObject(尰嵼偺僇乕僪BMP)
                                        尰嵼偺僇乕僪BMP = bm.GetHbitmap
                                        bm.Dispose()
                                        qqqqq("p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢 <> 1.0")
                                    End If
                                End If
                            End If
                            '--------------------------------------------------------------------------------
                            OKOKOK = 嘳BmpDrawMakeMask(ghDC2, bmptmp, 儕乕僕儑儞夋憸, 0, 0, True)
                        End If
                        'gggbol = 嘳Clipboard_SetImage_From_GDIBmp_Or_Image(bmptmp, Nothing)
                        'a = 0
                    End If
                    'ok ---------------------------------------------------
                    If OKOKOK Then
                        Dim oldbmp2 As Integer = SelectObject(ghDC2, bmptmp)
                        If oldbmp2 <> 0 Then
                            Dim oldbmp1 As Integer = SelectObject(ghDC1, 尰嵼偺僇乕僪BMP)
                            If oldbmp1 <> 0 Then
                                If 儕乕僕儑儞敀榞 = 0 Then
                                    榞暆幚悺 = 僼儗乕儉儔僀儞暆
                                Else
                                    榞暆幚悺 = 0
                                End If
                                奜榞暆幚悺 = Math.Max(1, (儕乕僕儑儞夋憸偺暆 + 儕乕僕儑儞夋憸偺崅偝) / 100)
                                gggint = OffsetRgn(儕乕僕儑儞夋憸, 儕乕僕儑儞夋憸偺暆, 0)
                                If 儕乕僕儑儞敀榞 <> 0 Then gggint = OffsetRgn(儕乕僕儑儞敀榞, 儕乕僕儑儞夋憸偺暆, 0)
                                Dim BRSH As Integer = CreateSolidBrush(&HFFFFFF&)
                                Dim BRSH奜榞 As Integer = CreateSolidBrush(&H0&)
                                Dim ret As Boolean = 嘳BmpDrawStretchBlt(ghDC2, bmptmp, 儕乕僕儑儞夋憸, 儕乕僕儑儞敀榞, 儕乕僕儑儞夋憸偺暆, 0, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝, ghDC1, 0, 0, Bit揮憲尦WD, Bit揮憲尦HT, BRSH, 榞暆幚悺, BRSH奜榞, 奜榞暆幚悺)
                                If BRSH <> 0 Then gggint = DeleteObject(BRSH)
                                If BRSH奜榞 <> 0 Then gggint = DeleteObject(BRSH奜榞)
                                BRSH = 0
                                BRSH奜榞 = 0
                                'gggbol = 嘳Clipboard_SetImage_From_GDIBmp_Or_Image(bmptmp, Nothing)
                                'gggbol = 嘳Clipboard_SetImage_From_GDIBmp_Or_Image(尰嵼偺僇乕僪BMP, Nothing)
                                'a = 0
                                gggint = BitBlt(ghDC1, 0, 0, 儕乕僕儑儞夋憸偺暆 * 2, 儕乕僕儑儞夋憸偺崅偝, ghDC2, 0, 0, SRCCOPY)
                                gggint = SelectObject(ghDC1, oldbmp1)
                                If ret = False Then
                                    MsgBox("zz怴偟偄堏摦昤夋偺僨乕僞乕傪嶌傞() 偱僄儔乕偑敪惗丅" & gggCR2 & "偙偺傾僾儕働乕僔儑儞傪廔椆偟偰偔偩偝偄丅")
                                    GoTo 傾僾儕廔椆帪偺_ExitFunction
                                End If
                            End If
                            gggint = SelectObject(ghDC2, oldbmp2)
                            gggint = DeleteObject(bmptmp)
                            bmptmp = 0
                            'gggbol = 嘳Clipboard_SetImage_From_GDIBmp_Or_Image(尰嵼偺僇乕僪BMP, Nothing)
                            'a = 0
                        End If
                    Else
                        Debug.Print("堏摦昤夋梡BMP偺嶌惉偵幐攕  " & CStr(儕乕僕儑儞夋憸偺暆) & ", " & CStr(儕乕僕儑儞夋憸偺崅偝))
                        GoTo 傾僾儕廔椆帪偺_ExitFunction
                    End If
                Else
                    Debug.Print("堏摦昤夋梡BMP偺嶌惉偵幐攕  " & CStr(儕乕僕儑儞夋憸偺暆) & ", " & CStr(儕乕僕儑儞夋憸偺崅偝))
                    GoTo 傾僾儕廔椆帪偺_ExitFunction
                End If
            End If
            If 儕乕僕儑儞夋憸 <> 0 Then gggint = DeleteObject(儕乕僕儑儞夋憸)
            儕乕僕儑儞夋憸 = 0
            If 儕乕僕儑儞敀榞 <> 0 Then gggint = DeleteObject(儕乕僕儑儞敀榞)
            儕乕僕儑儞敀榞 = 0
        End If
        '--------------------------------------------------------------------------------
        '*************************************************************************************************************************************************************************************
        Dim CardShowStepStopID As Integer
        gggbol = zz僇乕僪僔儑乕偺堏摦僨乕僞乕傪嶌傞(mMoveData, mMoveDataJmpDef, m僼僅乕儉慡椞堟copy, m僇乕僪孮椞堟copy, _
                                     惓曽宍偵偡傞, p僇乕僪僔儑乕儌乕僪, o僇乕僪偺堏摦僗僥僢僾悢Value, o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢, CardShowStepStopID, _
                                     m僼僅乕儉慡椞堟暆, m僼僅乕儉慡椞堟崅, CardWDwnd, CardHTwnd, CardWDwndmax, CardHTwndmax, CTY, CTX, CTYJP)
        '*************************************************************************************************************************************************************************************
        '*************************************************************************************************************************************************************************************
        '*************************************************************************************************************************************************************************************
        '僇乕僪偺柾條傪儊僀儞僂僀儞僪僂偵揮幨偡傞丅
        '--------------------------------------------------------------------------------
        Dim EXIT_LOOP_巜昗 As String = ""
        '--------------------------------------------------------------------------------
        If frmMain.pct儊僀儞.Visible Then frmMain.pct儊僀儞.Visible = False
        '--------------------------------------------------------------------------------
        Dim frmMainHDC As Integer = GetDC(CInt(frmMain.Handle))
        If frmMainHDC = 0 Then GoTo EXIT_LOOP
        gggint = SetStretchBltMode(frmMainHDC, COLORONCOLOR)
        '--------------------------------------------------------------------------------
        Dim oldBMP As Integer = 0
        oldBMP = SelectObject(ghDC1, 尰嵼偺僇乕僪BMP)
        If oldBMP = 0 Then GoTo EXIT_LOOP
        '********************************************************************************
        If vv怴偟偄攚宨夋憸傪僙僢僩偡傞 Then
            gggbol = zz攚宨夋憸偺憖嶌(2, frmMainHDC, frmMain)
            vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = False
        End If
        '********************************************************************************
        Dim CurIDX As Integer
        Dim rcuke As RECT
        Dim rc昤夋埵抲 As RECT, rc昤夋暆 As Integer, rc昤夋崅 As Integer
        Dim en, wOutWnd, OverSize
        '--------------------------------------------------------------------------------
        For CurIDX = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢
            '************************************************
            If gm傾僾儕廔椆偡傞 Then
                EXIT_LOOP_巜昗 = "傾僾儕廔椆帪偺_ExitFunction"
                Exit For    'GoTo 傾僾儕廔椆帪偺_ExitFunction
            End If
            '********************************************************************************
            If gm僎乕儉寢壥僷僱儖昞帵偑徚嫀偝傟偨 Or (vvfrmMainClientSizeWidthCUR <> frmMain.ClientSize.Width Or vvfrmMainClientSizeHeightCUR <> frmMain.ClientSize.Height) Then
                vvfrmMainClientSizeWidthCUR = frmMain.ClientSize.Width : vvfrmMainClientSizeHeightCUR = frmMain.ClientSize.Height
                gm僎乕儉寢壥僷僱儖昞帵偑徚嫀偝傟偨 = False
                gm僇乕僪儖乕僾掆巭尨場 = 555
                vv怴偟偄攚宨夋憸傪僙僢僩偡傞 = True
                gggbol = zz攚宨夋憸偺憖嶌(3, frmMainHDC, frmMain)
                EXIT_LOOP_巜昗 = "BMP嶍彍_CallDoEvents"
                Exit For
            End If
            '********************************************************************************
            ccc = (12 / p僔儑乕僇乕僪偺僗僺乕僪)
            a = CInt(ccc ^ 2)
            Call Sleep(a)
            'qqqqq CStr(a)
            '------------------------------------------
            wOutWnd = False
            OverSize = False
            gggint = CopyRect(rc昤夋埵抲, mMoveData(0, CurIDX))
            rc昤夋暆 = 嘳Rect暆(rc昤夋埵抲)
            rc昤夋崅 = 嘳Rect崅(rc昤夋埵抲)
            '------------------------------------------
            If p僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕儁僞儁僞 Then wOutWnd = (wOutWnd Or (rc昤夋埵抲.lll = 100000))
            en = (rc昤夋埵抲.lll < 10000) 'c僇乕僪僔儑乕儁僞儁僞丂偺応崌偼娫寚張棟偵偡傞
            If en Then
                Select Case p僇乕僪僔儑乕儌乕僪
                    Case c僇乕僪僔儑乕僘乕儉, c僇乕僪僔儑乕僗儔僀僪, c僇乕僪僔儑乕僋儖僋儖, c僇乕僪僔儑乕傾僠僐僠, c僇乕僪僔儑乕儁僞儁僞, c僇乕僪僔儑乕僗僋僗僋, c僇乕僪僔儑乕僼儔僼儔, c僇乕僪僔儑乕僕儍儞僾
                        If o偡傋偰偺僇乕僪宆傪巊梡偡傞 Then
                            gggint = StretchBlt(frmMainHDC, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋暆, rc昤夋崅, ghDC1, 0, 0, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝, SRCPAINT)
                            gggint = StretchBlt(frmMainHDC, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋暆, rc昤夋崅, ghDC1, 儕乕僕儑儞夋憸偺暆, 0, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝, SRCAND)
                        Else
                            gggint = StretchBlt(frmMainHDC, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋暆, rc昤夋崅, ghDC1, 0, 0, Bit揮憲尦WD, Bit揮憲尦HT, SRCCOPY)
                        End If
                        If cur僔儑乕僇乕僪僀儊乕僕 = c僇乕僪僔儑乕暥帤 And p僇乕僪僔儑乕儌乕僪 <> c僇乕僪僔儑乕僕儍儞僾 Then '2016/0312
                            OverSize = (rc昤夋暆 * 1.2 > ((CardWDwndmax + CardHTwndmax) \ 2)) '2016/0312
                        ElseIf p僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僘乕儉 Then
                            OverSize = (rc昤夋暆 * 1.2 > CardWDwndmax) Or (rc昤夋崅 * 1.2 > CardHTwndmax)
                        Else
                            If p僇乕僪僔儑乕儌乕僪 <> c僇乕僪僔儑乕僕儍儞僾 Then '2016/0312
                                OverSize = (rc昤夋暆 > CardWDwndmax) Or (rc昤夋崅 > CardHTwndmax)
                            End If
                        End If
                    Case c僇乕僪僔儑乕僗僩僢僾
                        If o偡傋偰偺僇乕僪宆傪巊梡偡傞 Then
                            If (Not OverSize) Then
                                gggint = StretchBlt(frmMainHDC, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋暆, rc昤夋崅, ghDC1, 0, 0, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝, SRCPAINT)
                                gggint = StretchBlt(frmMainHDC, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋暆, rc昤夋崅, ghDC1, 儕乕僕儑儞夋憸偺暆, 0, 儕乕僕儑儞夋憸偺暆, 儕乕僕儑儞夋憸偺崅偝, SRCAND)
                            End If
                        Else
                            If (Not OverSize) Then
                                gggint = StretchBlt(frmMainHDC, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋暆, rc昤夋崅, ghDC1, 0, 0, Bit揮憲尦WD, Bit揮憲尦HT, SRCCOPY)
                            End If
                        End If
                        OverSize = (CardShowStepStopID = CurIDX)
                End Select
                '------------------------------------------
                If o偡傋偰偺僇乕僪宆傪巊梡偡傞 Then
                    'no op
                Else
                    '僇乕僪偺僼儗乕儉傪昤偔
                    Select Case cur僔儑乕僇乕僪僀儊乕僕
                        Case c僇乕僪僔儑乕慡夋憸, c僇乕僪僔儑乕慡柾條
                            gggint = SetRect(tmprect, rc昤夋埵抲.lll, rc昤夋埵抲.ttt, rc昤夋埵抲.rrr - 1, rc昤夋埵抲.bbb - 1)
                            b = Math.Max(1, Math.Min(嘳Rect暆(tmprect), 嘳Rect崅(tmprect)) / 50)
                            gggint = 嘳昤夋挿曽宍榞_慄暆巜掕_儁儞巜掕(frmMainHDC, tmprect, mm儁儞崟, b, 0)
                    End Select
                End If
                '------------------------------------------
                '堦僒僀僋儖偺廔傢傝傪寛掕偡傞
                If p僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕儁僞儁僞 Then
                    '慜曽偱丂wOutWnd = (.left = 100000)丂偱寛掕嵪傒
                ElseIf p僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僗僋僗僋 Then
                    wOutWnd = (CurIDX >= o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢) Or (CurIDX >= o僇乕僪偺堏摦僗僥僢僾悢Value) Or (rc昤夋暆 > CardWDwndmax) Or (rc昤夋崅 > CardHTwndmax)
                Else
                    wOutWnd = (CurIDX >= o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢) Or (IntersectRect(rcuke, m僼僅乕儉慡椞堟copy, mMoveData(0, CurIDX)) = 0)
                    wOutWnd = wOutWnd Or (CurIDX = o僇乕僪偺堏摦僗僥僢僾悢Value) Or OverSize
                End If
            End If
            '------------------------------------------
            If wOutWnd Then
                With frmMain
                    If 摨堦儌乕僪偱偺弌尰夞悢 < o儌乕僪偛偲偺弌尰夞悢Value Then
                        EXIT_LOOP_巜昗 = "BMP嶍彍_CallDoEvents" : Exit For             'GoTo BMP嶍彍_CallDoEvents
                    ElseIf p僇乕僪僔儑乕偼儖乕僾偱幚峴 Or gm僇乕僪僔儑乕暋悢儌乕僪 Then
                        If gm僇乕僪僔儑乕暋悢儌乕僪 Then
                            If p儌乕僪偛偲偺弌尰夞悢Value = 摨堦儌乕僪偱偺弌尰夞悢 Then
                                If p僇乕僪僔儑乕偼儖乕僾偱幚峴 Then

                                Else
                                    If 儌乕僪偺夞悢椵寁 < 儌乕僪偺夞悢 Then
                                        '暋悢儌乕僪傪堦夞偩偗偡傋偰傪幚峴
                                    Else
                                        EXIT_LOOP_巜昗 = "僔儑乕儖乕僾傪廔椆偟偰_ExitFunction" : Exit For  'GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction '侾夞偩偗幚峴偡傞応崌偼廔椆
                                    End If
                                End If
                            End If
                        End If
                        If p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾 Then
                            '.Cls()
                            .Refresh()
                        End If
                        摨堦儌乕僪偱偺弌尰夞悢 = 0
                        EXIT_LOOP_巜昗 = "BMP嶍彍_CallDoEvents" : Exit For             'GoTo BMP嶍彍_CallDoEvents
                    Else
                        EXIT_LOOP_巜昗 = "僔儑乕儖乕僾傪廔椆偟偰_ExitFunction" : Exit For  'GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction
                    End If
                End With
            End If
        Next
        '*************************************************************************************************************************************************************************************
EXIT_LOOP:
        If oldBMP <> 0 Then gggint = SelectObject(ghDC1, oldBMP)
        oldBMP = 0
        If frmMainHDC <> 0 Then ReleaseDC(CInt(frmMain.Handle), frmMainHDC)
        frmMainHDC = 0
        Select Case EXIT_LOOP_巜昗
            Case "BMP嶍彍_CallDoEvents"
                GoTo BMP嶍彍_CallDoEvents
            Case "僔儑乕儖乕僾傪廔椆偟偰_ExitFunction"
                GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction
            Case "傾僾儕廔椆帪偺_ExitFunction"
                GoTo 傾僾儕廔椆帪偺_ExitFunction
            Case Else
                GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction
        End Select
        Exit Function
        '*************************************************************************************************************************************************************************************
BMP嶍彍_CallDoEvents:
        '************************************************
        '廳梫'廳梫'廳梫'廳梫
        mDoEventsCall = True : System.Windows.Forms.Application.DoEvents() : mDoEventsCall = False
        '廳梫'廳梫'廳梫'廳梫
        '************************************************
        If gm傾僾儕廔椆偡傞 Then GoTo 傾僾儕廔椆帪偺_ExitFunction
        If gm僇乕僪儖乕僾掆巭尨場 = 999 Then
            GoTo 僔儑乕儖乕僾傪廔椆偟偰_ExitFunction
        ElseIf gm僇乕僪儖乕僾掆巭尨場 = 555 Then
            'qqqqq "On FormReSize"
        End If
        GoTo ChgNewChar
        '*************************************************************************************************************************************************************************************
僔儑乕儖乕僾傪廔椆偟偰_ExitFunction:
        gm僇乕僪僔儑乕暋悢儌乕僪 = False
        gm僇乕僪儖乕僾掆巭尨場 = 0
        摨堦儌乕僪偱偺弌尰夞悢 = 0
        'if test mode loop -------------------------------------------
        If gm昞帵拞_Dlg僇乕僪僔儑乕暋悢儌乕僪慖戰 = True Then Call frmDlg僇乕僪僔儑乕暋悢儌乕僪慖戰.ffShowTestStop()
        '------------------------------------------------------
        '尰嵼偺柾條偲夋憸僀儞僨僢僋僗傪儕僙僢僩  僇乕僪僔儑乕偲僗僀僗僀偱丂嫟梡偟偰偄傞偐傜
        gggbol = gm傾僾儕屌桳僋儔僗.aa僗僀僗僀_僔儑乕僇乕僪_僀儊乕僕憖嶌(200, p僔儑乕僇乕僪僀儊乕僕, False, 0, 0, 0, 0, Brush巐杮, 0, 0, 0, 0, 0, 0, 0) '尰嵼偺柾條偲夋憸僀儞僨僢僋僗傪儕僙僢僩
        gggbol = aa僇乕僪僔儑乕奐巒偲掆巭_SUB_BMP嶍彍傕偟偁傟偽(尰嵼偺僇乕僪BMP)
        'qqqqq "僔儑乕儖乕僾傪廔椆偟偰_ExitFunction"
        '--------------------------------------------------------------------------------
        Call frmMain.mn1game僎乕儉僋儕傾_Click(Nothing, Nothing)
        '--------------------------------------------------------------------------------
        gggbol = 僀儀儞僩gAppEventMaker.MakeEvent僇乕僪僔儑乕奐巒偲掆巭(False)
        '--------------------------------------------------------------------------------
        Return True
        '*************************************************************************************************************************************************************************************
傾僾儕廔椆帪偺_ExitFunction:
        gggbol = aa僇乕僪僔儑乕奐巒偲掆巭_SUB_BMP嶍彍傕偟偁傟偽(尰嵼偺僇乕僪BMP)
        'qqqqq "gm傾僾儕廔椆偡傞 "
        Return True
    End Function
    '--------------------------------------------------------------------------
    Friend Function aa僇乕僪僔儑乕奐巒偲掆巭_SUB_BMP嶍彍傕偟偁傟偽(ByRef 尰嵼偺僇乕僪BMP As Integer) As Boolean
        If 尰嵼偺僇乕僪BMP <> 0 Then
            gggint = DeleteObject(尰嵼偺僇乕僪BMP)
            尰嵼偺僇乕僪BMP = 0
        End If
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz僇乕僪僔儑乕偺堏摦僨乕僞乕傪嶌傞(ByRef mMoveData(,) As RECT, ByRef mMoveDataJmpDef() As RECT, ByRef m僼僅乕儉慡椞堟copy As RECT, ByRef m僇乕僪孮椞堟copy As RECT, _
                            ByVal 惓曽宍偵偡傞 As Boolean, ByVal o僇乕僪僔儑乕儌乕僪 As Integer, ByVal o僇乕僪偺堏摦僗僥僢僾悢Value As Integer, ByVal o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢 As Integer, ByRef CardShowStepStopID As Integer, _
                            ByVal wndWD As Integer, ByVal wndHT As Integer, ByVal CardWDwnd As Integer, ByVal CardHTwnd As Integer, ByVal CardWDwndmax As Integer, ByVal CardHTwndmax As Integer, _
                            ByVal CTY As Single, ByVal CTX As Single, ByVal CTYJP As Single) As Boolean
        Dim a, b, c As Integer
        Dim zoombai, zoombaipxpy, ccc, ddd, eee, px, py, xx1, xx2, yy1, yy2, ctxx, ctyy, www1, www2, hhh1, hhh2, xysfht, sfht, radia As Single
        '偙偙偱僇乕僪僔儑乕偺堏摦僨乕僞乕傪嶌傞丅
        Randomize()
        Select Case o僇乕僪僔儑乕儌乕僪
            '--------------------------------------------------------------------------------
            Case c僇乕僪僔儑乕僘乕儉
                '僘乕儉偺僨乕僞乕攝楍傪嶌傞丅mMoveData(0, 1 to c僇乕僪僔儑乕嵟戝夞悢)
                '---------------------------------------------------------------------------------------------
                zoombai = 1.0# + (5.0# / (o僇乕僪偺堏摦僗僥僢僾悢Value * o僇乕僪偺堏摦僗僥僢僾悢Value))
                '---------------------------------------------------------------------------------------------
                ddd = (wndWD + wndHT) / 30
                px = (嘳悢抣斖埻Sng(ddd / 20, ddd, Rnd() * ddd) / 15) * zoombai
                py = (嘳悢抣斖埻Sng(ddd / 20, ddd, Rnd() * ddd) / 15) * zoombai
                px = Math.Max(0.001, px)
                py = Math.Max(0.001, py)
                If (Rnd() < 0.5) Then px = -px
                If (Rnd() < 0.5) Then py = -py
                '---------------------------------------
                If 惓曽宍偵偡傞 Then ccc = 1.0# Else ccc = CardHTwnd / CardWDwnd
                '---------------------------------------
                xx2 = Math.Max(10, CardWDwnd / 6)
                '---------------------------------------------------------------------------------------------
                zoombai = 1.04 + (100.0# / (o僇乕僪偺堏摦僗僥僢僾悢Value * o僇乕僪偺堏摦僗僥僢僾悢Value))
                zoombaipxpy = (zoombai - 1.0#) * (0.3 + Rnd() * 0.7) + 1
                '---------------------------------------------------------------------------------------------
                For a = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value
                    xx2 = xx2 * zoombai
                    xx1 = xx2 / 2
                    yy2 = xx2 * ccc
                    yy1 = yy2 / 2
                    px = px * zoombaipxpy
                    py = py * zoombaipxpy
                    b = a - 1
                    mMoveData(0, a).lll = CTX + (b * px - xx1)
                    mMoveData(0, a).ttt = CTY + (b * py - yy1)
                    mMoveData(0, a).rrr = mMoveData(0, a).lll + xx2
                    mMoveData(0, a).bbb = mMoveData(0, a).ttt + yy2
                Next
                '--------------------------------------------------------------------------------
            Case c僇乕僪僔儑乕僕儍儞僾
                '僕儍儞僾偺僨乕僞乕攝楍傪嶌傞丅mMoveData(0, 1 to c僇乕僪僔儑乕嵟戝夞悢)
                b = 2
                Select Case o僇乕僪偺堏摦僗僥僢僾悢Value
                    Case 30 : b = 2
                    Case 50 : b = 2
                    Case 75 : b = 1
                    Case 100 : b = 1
                End Select
                If Rnd() < 0.5 Then eee = 1.0# Else eee = -1.0#
                ccc = Rnd()
                ddd = Rnd()
                ctxx = CTX - CardWDwnd / 2.0#
                ctyy = CTYJP - CardHTwnd / 2.0#
                '---------------------------------------
                If 惓曽宍偵偡傞 Then
                    www2 = (CardWDwnd + CardHTwnd) / 2 : hhh2 = www2
                Else
                    www2 = CardWDwnd : hhh2 = CardHTwnd
                End If
                '---------------------------------------
                For a = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value
                    c = a * b
                    mMoveData(0, a).lll = ctxx + eee * (mMoveDataJmpDef(c).lll * ccc)
                    mMoveData(0, a).ttt = ctyy + (mMoveDataJmpDef(c).ttt * ddd)
                    mMoveData(0, a).rrr = mMoveData(0, a).lll + www2
                    mMoveData(0, a).bbb = mMoveData(0, a).ttt + hhh2
                Next
                'qqqqq CStr(a)
                '--------------------------------------------------------------------------------
            Case c僇乕僪僔儑乕僗僩僢僾
                If Rnd() < 0.5 Then eee = 1.0# Else eee = -1.0#
                px = (Rnd() + 0.3) * (嘳Rect暆(m僇乕僪孮椞堟copy) / 40.0#)
                py = (Rnd() + 0.3) * (嘳Rect崅(m僇乕僪孮椞堟copy) / 40.0#)
                If Rnd() < 0.5 Then px = 0.0# Else py = 0.0#
                www2 = CardWDwnd * 1.1
                hhh2 = CardHTwnd * 1.1
                '---------------------------------------
                If 惓曽宍偵偡傞 Then
                    www2 = (www2 + hhh2) / 2 : hhh2 = www2
                End If
                '---------------------------------------
                www1 = www2 / 2.0#
                hhh1 = hhh2 / 2.0#
                xx1 = 嘳Rect暆(m僼僅乕儉慡椞堟copy)
                yy1 = 嘳Rect崅(m僼僅乕儉慡椞堟copy)
                If px = 0 Then
                    If eee = 1.0# Then ctyy = m僼僅乕儉慡椞堟copy.ttt + hhh1 Else ctyy = m僼僅乕儉慡椞堟copy.bbb - hhh1
                    ctxx = 嘳悢抣斖埻Sng(www1, xx1 - www1, xx1 * Rnd())
                Else
                    If eee = 1.0# Then ctxx = m僼僅乕儉慡椞堟copy.lll + www1 Else ctxx = m僼僅乕儉慡椞堟copy.rrr - www1
                    ctyy = 嘳悢抣斖埻Sng(hhh1, yy1 - hhh1, yy1 * Rnd())
                End If
                ctxx = ctxx - www1 : ctyy = ctyy - hhh1
                If py = 0 Then
                    If eee > 0 Then ccc = 嘳悢抣斖埻Sng(xx1 / 2, xx1 - www2, xx1 * Rnd()) Else ccc = 嘳悢抣斖埻Sng(0, xx1 / 2, xx1 * Rnd())
                Else
                    If eee > 0 Then ccc = 嘳悢抣斖埻Sng(yy1 / 2, yy1 - hhh2, yy1 * Rnd()) Else ccc = 嘳悢抣斖埻Sng(0, yy1 / 2, yy1 * Rnd())
                End If
                CardShowStepStopID = 0
                For a = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value
                    mMoveData(0, a).lll = ctxx + a * px * eee
                    mMoveData(0, a).ttt = ctyy + a * py * eee
                    mMoveData(0, a).rrr = mMoveData(0, a).lll + www2
                    mMoveData(0, a).bbb = mMoveData(0, a).ttt + hhh2
                    If py = 0 Then
                        If eee > 0 Then
                            If mMoveData(0, a).lll > ccc Then CardShowStepStopID = a
                        Else
                            If mMoveData(0, a).lll < ccc Then CardShowStepStopID = a
                        End If
                    ElseIf px = 0 Then
                        If eee > 0 Then
                            If mMoveData(0, a).ttt > ccc Then CardShowStepStopID = a
                        Else
                            If mMoveData(0, a).ttt < ccc Then CardShowStepStopID = a
                        End If
                    End If
                    If CardShowStepStopID = a Then Exit For
                Next
                '--------------------------------------------------------------------------------
            Case c僇乕僪僔儑乕僗儔僀僪, c僇乕僪僔儑乕僋儖僋儖, c僇乕僪僔儑乕傾僠僐僠, c僇乕僪僔儑乕僗僋僗僋, c僇乕僪僔儑乕僼儔僼儔
                ddd = 1.0# + Rnd()
                www2 = CardWDwnd * ddd
                hhh2 = CardHTwnd * ddd
                '---------------------------------------
                If 惓曽宍偵偡傞 Then
                    www2 = (www2 + hhh2) / 2 : hhh2 = www2
                End If
                '---------------------------------------
                Select Case o僇乕僪僔儑乕儌乕僪
                    Case c僇乕僪僔儑乕僋儖僋儖, c僇乕僪僔儑乕僗僋僗僋
                        www2 = www2 * 0.3
                        hhh2 = hhh2 * 0.3
                        xx1 = 嘳Rect暆(m僼僅乕儉慡椞堟copy) / 2.0#
                        yy1 = 嘳Rect崅(m僼僅乕儉慡椞堟copy) / 2.0#
                        ctxx = (xx1 / 2.0#) + (Rnd() * xx1) - (www2 / 2.0#) '奐巒僙儞僞乕嵗昗
                        ctyy = (yy1 / 2.0#) + (Rnd() * yy1) - (hhh2 / 2.0#) '奐巒僙儞僞乕嵗昗
                        ccc = xx1 * (Rnd() * 0.3 + 0.1) '奐巒偺敿宎
                        px = Rnd() * 8 '堏摦嵗昗偺僺僢僠
                        py = Rnd() * 8 '堏摦嵗昗偺僺僢僠
                        If Rnd() < 0.5 Then eee = 1 Else eee = -1 '嵍夞傝乛塃夞傝
                        If Rnd() < 0.5 Then ddd = 0 Else ddd = 3.14 '僗僞乕僩帪偺埵憡
                        zoombai = 1.005 + Rnd() * 0.005 '敿宎偺憹戝棪
                        If o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僋儖僋儖 Then
                            radia = 1.5 * System.Math.Sqrt(System.Math.Sqrt(www2)) * 3.14 / ccc '堦夞偺儔僕傾儞僗僥僢僾悢
                            radia = radia * 150.0# / o僇乕僪偺堏摦僗僥僢僾悢Value '2014/05/24 add  '堦夞偺儔僕傾儞僗僥僢僾悢傪僇乕僪悢丂p僇乕僪偺堏摦僗僥僢僾悢丂偵斀斾椺偝偣傞
                        Else 'c僇乕僪僔儑乕僗僋僗僋
                            xx1 = 0.015 * System.Math.Sqrt(www2) / 10.0#
                            radia = xx1 + 6.28 / (3.0# + CSng(CShort(Rnd() * 6.0#))) '堦夞偺儔僕傾儞僗僥僢僾悢
                            px = px * www2 / 40
                            py = py * hhh2 / 40

                        End If
                        'qqqqq "堦夞偺儔僕傾儞僗僥僢僾悢 = " + cstr(radia)
                        For a = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value
                            c = a - 1
                            ccc = ccc * zoombai
                            px = px * zoombai
                            py = py * zoombai
                            www2 = www2 * zoombai
                            hhh2 = hhh2 * zoombai
                            mMoveData(0, a).lll = ctxx + px + System.Math.Cos(ddd + eee * radia * c) * ccc
                            mMoveData(0, a).ttt = ctyy + py + System.Math.Sin(ddd + eee * radia * c) * ccc
                            mMoveData(0, a).rrr = mMoveData(0, a).lll + www2
                            mMoveData(0, a).bbb = mMoveData(0, a).ttt + hhh2
                        Next
                    Case c僇乕僪僔儑乕僗儔僀僪, c僇乕僪僔儑乕傾僠僐僠, c僇乕僪僔儑乕僼儔僼儔
                        Randomize()
                        px = ddd * (Rnd() + 0.3) * (嘳Rect暆(m僇乕僪孮椞堟copy) / 50.0#)
                        py = ddd * (Rnd() + 0.3) * (嘳Rect崅(m僇乕僪孮椞堟copy) / 50.0#)
                        If o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僼儔僼儔 Or o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕傾僠僐僠 Then
                            sfht = 70.0# * (0.1 + Rnd() * 0.9)
                            radia = 嘳悢抣斖埻Sng(0.07, 0.2, 0.06 + (Rnd() * 0.15))
                            zoombai = 1.01 + Rnd() * 0.02 '憹戝棪
                            www2 = www2 * 0.3
                            hhh2 = hhh2 * 0.3
                            px = px * 0.3
                            py = py * 0.3
                            'qqqqq Format(radia, "#0.00000000")
                        ElseIf o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僗儔僀僪 Then
                            ccc = 0.4 + Rnd()
                            www2 = Math.Min(www2 * ccc, CardWDwndmax / 1.2 - 2.0#)
                            hhh2 = Math.Min(hhh2 * ccc, CardHTwndmax / 1.2 - 2.0#)
                            px = Math.Max(px, 2.0#)
                            py = Math.Max(py, 2.0#)
                        End If
                        If o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僼儔僼儔 Or o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僗儔僀僪 Then
                            If Rnd() < 0.5 Then px = 0 Else py = 0
                        End If
                        ctxx = (m僇乕僪孮椞堟copy.lll + www2 + (嘳Rect暆(m僇乕僪孮椞堟copy) - www2 - www2) * Rnd()) - (www2 / 2)
                        ctyy = (m僇乕僪孮椞堟copy.ttt + hhh2 + (嘳Rect崅(m僇乕僪孮椞堟copy) - hhh2 - hhh2) * Rnd()) - (hhh2 / 2)
                        If Rnd() < 0.5 Then px = -px
                        If Rnd() < 0.5 Then py = -py
                        '---------------------------------------
                        If 惓曽宍偵偡傞 Then
                            www2 = (www2 + hhh2) / 2 : hhh2 = www2
                        End If
                        '---------------------------------------
                        For a = 1 To o僇乕僪偺堏摦僗僥僢僾悢Value
                            b = a - 1
                            If o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僼儔僼儔 Or o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕傾僠僐僠 Then
                                px = px * zoombai
                                py = py * zoombai
                                www2 = www2 * zoombai
                                hhh2 = hhh2 * zoombai
                                If o僇乕僪僔儑乕儌乕僪 = c僇乕僪僔儑乕僼儔僼儔 Then
                                    sfht = sfht * zoombai
                                    xysfht = System.Math.Sin(CSng(a) * radia + 1.57) * sfht
                                    mMoveData(0, a).lll = ctxx + a * px + IIf(px = 0, xysfht, 0)
                                    mMoveData(0, a).ttt = ctyy + a * py + IIf(py = 0, xysfht, 0)
                                Else
                                    mMoveData(0, a).lll = ctxx + a * px
                                    mMoveData(0, a).ttt = ctyy + a * py
                                End If
                            Else
                                mMoveData(0, a).lll = ctxx + a * px
                                mMoveData(0, a).ttt = ctyy + a * py
                            End If
                            mMoveData(0, a).rrr = mMoveData(0, a).lll + www2
                            mMoveData(0, a).bbb = mMoveData(0, a).ttt + hhh2
                        Next
                End Select
                '--------------------------------------------------------------------------------
            Case c僇乕僪僔儑乕儁僞儁僞
                xx1 = CardWDwnd * 1.5
                yy1 = CardHTwnd * 1.5
                '---------------------------------------
                If 惓曽宍偵偡傞 Then
                    xx1 = (xx1 + yy1) \ 2 : yy1 = xx1
                End If
                '---------------------------------------
                For a = 0 To o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢
                    mMoveData(0, a).lll = 10000 'en = (.left < 10000)  c僇乕僪僔儑乕儁僞儁僞丂偺応崌偼娫寚張棟偵偡傞
                Next
                c = o僇乕僪偺堏摦僗僥僢僾悢Value \ 2    '/ 3        2022/12/14
                For a = 1 To c Step 5                 'Step 10    2022/12/14
                    ccc = 0.5 + Rnd()
                    www2 = xx1 * ccc
                    hhh2 = yy1 * ccc
                    mMoveData(0, a).lll = m僇乕僪孮椞堟copy.lll + (嘳Rect暆(m僇乕僪孮椞堟copy) * Rnd() - (www2 / 2))
                    mMoveData(0, a).ttt = m僇乕僪孮椞堟copy.ttt + (嘳Rect崅(m僇乕僪孮椞堟copy) * Rnd() - (hhh2 / 2))
                    mMoveData(0, a).rrr = mMoveData(0, a).lll + www2
                    mMoveData(0, a).bbb = mMoveData(0, a).ttt + hhh2
                Next
                If a < o僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢 Then mMoveData(0, a + 1).lll = 100000 'show stop code  OverSize = (.left = 100000)
        End Select
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz昞帵拞frmDlg僇乕僪僔儑乕僆僾僔儑儞() As Boolean
        Return gAppEventMaker.僼僅乕儉偺昞帵徚嫀_愝掕偲庢摼(0, gmDlg僇乕僪僔儑乕僆僾僔儑儞, False)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(ByVal 僾儘僷柤 As String) As Boolean
        If zz昞帵拞frmDlg僇乕僪僔儑乕僆僾僔儑儞() Then
            Call frmDlg僇乕僪僔儑乕僆僾僔儑儞.aaBtnOptStateSet(僾儘僷柤)
            Return True
        End If
        Return False
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Function zz攚宨夋憸偺憖嶌(ByVal op As Integer, ByVal frmMainHDC As Integer, ByVal fom As frmMain) As Boolean
        Static m巊梡拞儕僗僩IDX As Integer
        Static m僼傽僀儖孮偺柤慜攝楍() As String = {""}
        Static m僼傽僀儖孮偺柤慜攝楍_Max As Integer
        Dim wPctCurBmp廲墶斾棪 As Single
        Dim 僼傽僀儖 As String
        Dim Imgcopy As Image = Nothing
        Select Case op
            Case 1 '僗僞乕僩帪偺張棟
                m僼傽僀儖孮偺柤慜攝楍_Max = gm傾僾儕屌桳僋儔僗.DlgFile僎乕儉梡.aa夋憸僼傽僀儖儕僗僩僐僺乕(m僼傽僀儖孮偺柤慜攝楍, m巊梡拞儕僗僩IDX)
                '--------------------------------------------------------------------------
            Case 2 '尰嵼偺夋憸傪撉傒偩偟偰丄師偺夋憸傊僇僂儞僩傾僢僾偟偰偍偔
                僼傽僀儖 = m僼傽僀儖孮偺柤慜攝楍(m巊梡拞儕僗僩IDX)
                Dim sss = gm傾僾儕屌桳僋儔僗.DlgFile僎乕儉梡.aa夋憸僼傽僀儖僆乕僾儞_into_ImageBox_IfError_SetNextFile_帺摦揑偵(僼傽僀儖, Imgcopy, wPctCurBmp廲墶斾棪, m巊梡拞儕僗僩IDX)
                m巊梡拞儕僗僩IDX = m巊梡拞儕僗僩IDX + 1
                If m巊梡拞儕僗僩IDX > m僼傽僀儖孮偺柤慜攝楍_Max Then m巊梡拞儕僗僩IDX = 1
                'qqqqq(CStr(m巊梡拞儕僗僩IDX))
                '--------------------------------------------------------------------------
                If Imgcopy IsNot Nothing Then
                    'gggbol = 嘳Clipboard_SetImage_From_GDIBmp_Or_Image(0, Imgcopy)
                    Dim 庴偗暆, 庴偗崅, 憲傝暆, 憲傝崅 As Integer
                    庴偗暆 = fom.ClientSize.Width : 庴偗崅 = fom.ClientSize.Height - fom.mMenuHight : 憲傝暆 = Imgcopy.Width : 憲傝崅 = Imgcopy.Height
                    Dim wLeft, wTop, wWidth, wHeight As Integer
                    If 嘳僒僀僘寁嶼_庴偗偵崌傢偣偰_憲傝傪僩儕儈儞僌(庴偗暆, 庴偗崅, 憲傝暆, 憲傝崅, wLeft, wTop, wWidth, wHeight) Then
                        Dim bmp As Bitmap = Imgcopy
                        Dim hBitmap As Integer = bmp.GetHbitmap
                        If hBitmap <> 0 Then
                            Dim old As Integer = SelectObject(ghDC1, hBitmap)
                            If old <> 0 Then
                                gggint = StretchBlt(frmMainHDC, 0, fom.mMenuHight, 庴偗暆, 庴偗崅, ghDC1, wLeft, wTop, wWidth, wHeight, SRCCOPY)
                                SelectObject(ghDC1, old)
                            End If
                            DeleteObject(hBitmap)
                        End If
                    End If
                    Imgcopy.Dispose()
                End If
                '--------------------------------------------------------------------------
            Case 3 '儖乕僾撪偱丄尦偵栠傝丄尰嵼偺夋憸傪嵞昤夋偡傞偨傔偵僀儞僨僢僋僗傪尦偵栠偟偰偍偔
                m巊梡拞儕僗僩IDX = m巊梡拞儕僗僩IDX - 1
                If m巊梡拞儕僗僩IDX < 1 Then m巊梡拞儕僗僩IDX = m僼傽僀儖孮偺柤慜攝楍_Max
        End Select
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
#End Region

#Region "僾儘僷僥傿"
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa僾儘僷僥傿弶婜壔_INI撉弌偟彂崬傒sub(ByRef 僾儘僷僐儅儞僪 As Integer, ByRef ini攝楍() As String, ByRef CurIDX As Integer) As Boolean
        Dim AryMax As Integer = UBound(ini攝楍)
        Dim ssss As String, hedend As String = "*********************" + "僇乕僪僔儑乕僨乕僞乕" + "*********************"
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔
                Call p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW(僾儘僷僐儅儞僪)
                Call p僇乕僪僔儑乕儌乕僪_RW(僾儘僷僐儅儞僪)
                Call p僇乕僪僒僀僘戝拞彫_RW(僾儘僷僐儅儞僪)
                Call p僔儑乕僇乕僪偺僗僺乕僪_RW(僾儘僷僐儅儞僪)
                Call p僔儑乕僇乕僪偺柧傞偝_RW(僾儘僷僐儅儞僪)
                Call p僇乕僪僔儑乕偼儖乕僾偱幚峴_RW(僾儘僷僐儅儞僪)
                Call p僇乕僪偺堏摦僗僥僢僾悢_RW(僾儘僷僐儅儞僪)
                Call p儌乕僪偛偲偺弌尰夞悢_RW(僾儘僷僐儅儞僪)
                Call p僔儑乕僇乕僪僀儊乕僕_RW(僾儘僷僐儅儞僪)
                Call p偡傋偰偺僇乕僪宆傪巊梡偡傞_RW(僾儘僷僐儅儞僪)
                Call p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW(僾儘僷僐儅儞僪)
                Call p僔儑乕僇乕僪宆_RW(僾儘僷僐儅儞僪)
                Call p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(僾儘僷僐儅儞僪)
                Call p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(僾儘僷僐儅儞僪)
            Case gco僾儘僷iniRD
                Const ads As String = "="
                Dim Hedp僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW As String = p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW(gco僾儘僷柤) + ads
                Dim Hedp僇乕僪僔儑乕儌乕僪_RW As String = p僇乕僪僔儑乕儌乕僪_RW(gco僾儘僷柤) + ads
                Dim Hedp僇乕僪僒僀僘戝拞彫_RW As String = p僇乕僪僒僀僘戝拞彫_RW(gco僾儘僷柤) + ads
                Dim Hedp僔儑乕僇乕僪偺僗僺乕僪_RW As String = p僔儑乕僇乕僪偺僗僺乕僪_RW(gco僾儘僷柤) + ads
                Dim Hedp僔儑乕僇乕僪偺柧傞偝_RW As String = p僔儑乕僇乕僪偺柧傞偝_RW(gco僾儘僷柤) + ads
                Dim Hedp僇乕僪僔儑乕偼儖乕僾偱幚峴_RW As String = p僇乕僪僔儑乕偼儖乕僾偱幚峴_RW(gco僾儘僷柤) + ads
                Dim Hedp僇乕僪偺堏摦僗僥僢僾悢_RW As String = p僇乕僪偺堏摦僗僥僢僾悢_RW(gco僾儘僷柤) + ads
                Dim Hedp儌乕僪偛偲偺弌尰夞悢_RW As String = p儌乕僪偛偲偺弌尰夞悢_RW(gco僾儘僷柤) + ads
                Dim Hedp僔儑乕僇乕僪僀儊乕僕_RW As String = p僔儑乕僇乕僪僀儊乕僕_RW(gco僾儘僷柤) + ads
                Dim Hedp偡傋偰偺僇乕僪宆傪巊梡偡傞_RW As String = p偡傋偰偺僇乕僪宆傪巊梡偡傞_RW(gco僾儘僷柤) + ads
                Dim Hedp僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW As String = p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW(gco僾儘僷柤) + ads
                Dim Hedp僔儑乕僇乕僪宆_RW As String = p僔儑乕僇乕僪宆_RW(gco僾儘僷柤) + ads
                Dim Hedp僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW As String = p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(gco僾儘僷柤) + ads
                Dim Hedp僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW As String = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(gco僾儘僷柤) + ads
                For CurIDX = 1 To UBound(ini攝楍)
                    ssss = ini攝楍(CurIDX)
                    If InStr(ssss, Hedp僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW) = 1 Then
                        Call p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僇乕僪僔儑乕儌乕僪_RW) = 1 Then
                        Call p僇乕僪僔儑乕儌乕僪_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僇乕僪僒僀僘戝拞彫_RW) = 1 Then
                        Call p僇乕僪僒僀僘戝拞彫_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僔儑乕僇乕僪偺僗僺乕僪_RW) = 1 Then
                        Call p僔儑乕僇乕僪偺僗僺乕僪_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僔儑乕僇乕僪偺柧傞偝_RW) = 1 Then
                        Call p僔儑乕僇乕僪偺柧傞偝_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僇乕僪僔儑乕偼儖乕僾偱幚峴_RW) = 1 Then
                        Call p僇乕僪僔儑乕偼儖乕僾偱幚峴_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僇乕僪偺堏摦僗僥僢僾悢_RW) = 1 Then
                        Call p僇乕僪偺堏摦僗僥僢僾悢_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp儌乕僪偛偲偺弌尰夞悢_RW) = 1 Then
                        Call p儌乕僪偛偲偺弌尰夞悢_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僔儑乕僇乕僪僀儊乕僕_RW) = 1 Then
                        Call p僔儑乕僇乕僪僀儊乕僕_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp偡傋偰偺僇乕僪宆傪巊梡偡傞_RW) = 1 Then
                        Call p偡傋偰偺僇乕僪宆傪巊梡偡傞_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW) = 1 Then
                        Call p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僔儑乕僇乕僪宆_RW) = 1 Then
                        Call p僔儑乕僇乕僪宆_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW) = 1 Then
                        Call p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW) = 1 Then
                        Call p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(僾儘僷僐儅儞僪, 1, ssss)
                    End If
                Next
            Case gco僾儘僷iniWR
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = hedend Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪僔儑乕儌乕僪_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪僒僀僘戝拞彫_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僔儑乕僇乕僪偺僗僺乕僪_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僔儑乕僇乕僪偺柧傞偝_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪僔儑乕偼儖乕僾偱幚峴_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪偺堏摦僗僥僢僾悢_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p儌乕僪偛偲偺弌尰夞悢_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僔儑乕僇乕僪僀儊乕僕_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p偡傋偰偺僇乕僪宆傪巊梡偡傞_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僔儑乕僇乕僪宆_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= AryMax Then ini攝楍(CurIDX) = hedend Else Return True
        End Select
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function 僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍傪ListBox偐傜嶌傝_if_SetNew僾儘僷_僙僢僩僾儘僷僥傿(ByVal lst As ListBox, ByVal SetNew僾儘僷 As Boolean) As String
        'a = a + 1 : modes(a) = "0"
        'a = a + 1 : modes(a) = "1 僘乕儉   儌乕僪"
        'a = a + 1 : modes(a) = "2 僕儍儞僾 儌乕僪"
        'a = a + 1 : modes(a) = "3 僗儔僀僪 儌乕僪"
        'a = a + 1 : modes(a) = "4 僋儖僋儖 儌乕僪"
        'a = a + 1 : modes(a) = "5 僗僩僢僾 儌乕僪"
        'a = a + 1 : modes(a) = "6 傾僠僐僠 儌乕僪"
        'a = a + 1 : modes(a) = "7 儁僞儁僞 儌乕僪"
        'a = a + 1 : modes(a) = "8 僗僋僗僋 儌乕僪"
        'a = a + 1 : modes(a) = "9 僼儔僼儔 儌乕僪"
        Dim a, n As Integer
        Dim sss As String = "", s As String = ""
        For a = 0 To lst.Items.Count - 1
            s = lst.Items(a)
            n = Val(s)
            sss = sss & CStr(n)
        Next
        If SetNew僾儘僷 Then
            p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍 = sss
        Else
            'no op
        End If
        Return sss
    End Function
    Friend Function 僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍偐傜ListBox僙僢僩(ByVal lst As ListBox, ByVal modes() As String) As Integer
        Dim a, n, max As Integer
        Dim sss As String = p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍
        max = UBound(modes)
        lst.Items.Clear()
        For a = 1 To Len(sss)
            n = Val(Mid(sss, a, 1))
            If n > max Then Exit For
            lst.Items.Add(modes(n))
        Next
        Return lst.Items.Count
    End Function
    Friend Property p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍() As String
        'return "123456789" / "3675" / "123" / "6"   1 - 9丂寘偺悢帤暥帤楍
        Get
            Return p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍_RW(gco僾儘僷Get)
        End Get
        Set(ByVal Value As String)
            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
        Const PropName As String = "p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍" : Static 抣 As String : Dim a As Integer
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = "123456789"
            Case gco僾儘僷Get : Return 抣
            Case gco僾儘僷Let
                For a = 1 To Len(s)
                    If Mid(s, 1, 1) = "0" Then Mid(s, 1, 1) = "1"
                Next
                抣 = s
                If Len(s < 1) Then s = "1"
                If Len(s > 9) Then s = Left(s, 9)
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, 抣)
            Case gco僾儘僷iniRD : p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍 = 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p僇乕僪僔儑乕儌乕僪_僇乕僪僞僀僾_GET(ByVal optop_1_opnext_2 As Integer) As Integer
        Static 尰嵼偺僀儞僨僢僋僗 As Integer
        Dim sss As String = p僇乕僪僔儑乕儌乕僪偺幚峴弴彉暥帤楍
        If Len(sss) < 1 Then sss = "123456789"
        'qqqqq(sss)
        Select Case optop_1_opnext_2
            Case 1
                尰嵼偺僀儞僨僢僋僗 = 1
            Case Else
                尰嵼偺僀儞僨僢僋僗 = 尰嵼偺僀儞僨僢僋僗 + 1
                If 尰嵼偺僀儞僨僢僋僗 > Len(sss) Then 尰嵼偺僀儞僨僢僋僗 = 1
        End Select
        Return Val(Mid(sss, 尰嵼偺僀儞僨僢僋僗, 1))
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僇乕僪僔儑乕儌乕僪() As Integer
        Get
            Return CInt(p僇乕僪僔儑乕儌乕僪_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            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
        Const PropName As String = "p僇乕僪僔儑乕儌乕僪" : Static 抣 As Integer
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = 1
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Int(1, 9, Val(s))
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(1, 9, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僇乕僪僒僀僘戝拞彫() As Integer
        Get
            Return CInt(p僇乕僪僒僀僘戝拞彫_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            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
        Const PropName As String = "p僇乕僪僒僀僘戝拞彫" : Static 壓, 抣, 忋 As Integer
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = 3 : 壓 = 1 : 忋 = 5
            Case gco僾儘僷Get : p僇乕僪僒僀僘戝拞彫_RW = CStr(抣)
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷MenuClick : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僔儑乕僇乕僪偺僗僺乕僪() As Integer
        Get
            Return CInt(p僔儑乕僇乕僪偺僗僺乕僪_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            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
        Const PropName As String = "p僔儑乕僇乕僪偺僗僺乕僪" : Static 壓, 抣, 忋 As Integer
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = 4 : 壓 = 1 : 忋 = 6
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷MenuClick : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僔儑乕僇乕僪偺柧傞偝() As Integer
        Get
            Return CInt(p僔儑乕僇乕僪偺柧傞偝_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            Call p僔儑乕僇乕僪偺柧傞偝_RW(gco僾儘僷Let, CStr(Value))
        End Set
    End Property
    Friend Function p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢() As Single
        p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢 = Val(p僔儑乕僇乕僪偺柧傞偝_RW(397))
    End Function
    Private Function p僔儑乕僇乕僪偺柧傞偝_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        Const PropName As String = "p僔儑乕僇乕僪偺柧傞偝" : Static 壓, 忋, 抣 As Integer : Dim n As Single
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = 3 : 壓 = 1 : 忋 = 5
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷MenuClick : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
            Case 397 'p僔儑乕僇乕僪偺柧傞偝尰嵼偺幚悢 
                Select Case 抣 : Case 1 : n = 0.6 : Case 2 : n = 0.8 : Case 4 : n = 1.2 : Case 5 : n = 1.5 : Case Else : n = 1.0# : End Select
                Return CStr(n)
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僇乕僪僔儑乕偼儖乕僾偱幚峴() As Boolean
        Get
            Return CBool(p僇乕僪僔儑乕偼儖乕僾偱幚峴_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Boolean)
            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
        Const PropName As String = "p僇乕僪僔儑乕偼儖乕僾偱幚峴" : Static 抣 As Boolean
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = True    'Call aa儊僯儏乕僆僽僕僃愝掕(PropName, 伂, 仺, 仼)
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = CBool(s)
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = IIf(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s) = "True", True, False)
            Case gco僾儘僷MenuClick : 抣 = IIf(Val(s) = 0, True, False)
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend ReadOnly Property p僇乕僪偺堏摦僗僥僢僾悢Value嵟彫悢() As Integer
        Get
            Return CInt(p僇乕僪偺堏摦僗僥僢僾悢_RW(1012345))
        End Get
    End Property
    Friend ReadOnly Property p僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢() As Integer
        Get
            Return CInt(p僇乕僪偺堏摦僗僥僢僾悢_RW(1012346))
        End Get
    End Property
    Friend Property p僇乕僪偺堏摦僗僥僢僾悢Value() As Integer
        Get
            Return CInt(p僇乕僪偺堏摦僗僥僢僾悢_RW(gco僾儘僷Get尰嵼偺幚岠抣傪))
        End Get
        Set(ByVal Value As Integer)
            Call p僇乕僪偺堏摦僗僥僢僾悢_RW(gco僾儘僷Let尰嵼偺幚岠抣偱, CStr(Value))
        End Set
    End Property
    Friend Property p僇乕僪偺堏摦僗僥僢僾悢() As Integer
        Get
            Return CInt(p僇乕僪偺堏摦僗僥僢僾悢_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            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
        Const PropName As String = "p僇乕僪偺堏摦僗僥僢僾悢"
        Static 壓, 抣, 忋 As Integer  '抣 = 僀儞僨僢僋僗丂1 to 4
        Dim a, n As Integer
        Static 僗僥僢僾悢Value() As Integer = {1, 30, 50, 75, 100}  '僀儞僨僢僋僗偼 (1 to 4)  30 to 100 '僇乕僪僔儑乕偱侾枃枅偵僞僀儅乕偵傛傝昤夋偡傞夞悢丅 嵟彫 to 嵟戝
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 壓 = 1 : 忋 = 4 : 抣 = 2
            Case gco僾儘僷Get : Return CStr(嘳悢抣斖埻Int(壓, 忋, 抣))
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
            Case gco僾儘僷Get尰嵼偺幚岠抣傪      'Get p僇乕僪偺堏摦僗僥僢僾悢Value() 
                Return CStr(僗僥僢僾悢Value(嘳悢抣斖埻Int(壓, 忋, 抣)))
            Case gco僾儘僷Let尰嵼偺幚岠抣偱      'Let p僇乕僪偺堏摦僗僥僢僾悢Value()
                n = Val(s)
                For a = 壓 To 忋
                    If n <= 僗僥僢僾悢Value(a) Then
                        抣 = a : Exit For
                    End If
                Next
            Case gco僾儘僷MenuClick
                抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case 1012345  'p僇乕僪偺堏摦僗僥僢僾悢Value嵟戝悢
                Return CStr(僗僥僢僾悢Value(1))
            Case 1012346  'p僇乕僪偺堏摦僗僥僢僾悢Value嵟彫悢
                Return CStr(僗僥僢僾悢Value(4))
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷Let尰嵼偺幚岠抣偱, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p儌乕僪偛偲偺弌尰夞悢Value() As Integer
        Get
            Return CInt(p儌乕僪偛偲偺弌尰夞悢_RW(gco僾儘僷Get尰嵼偺幚岠抣傪))
        End Get
        Set(ByVal Value As Integer)
            Call p儌乕僪偛偲偺弌尰夞悢_RW(gco僾儘僷Let尰嵼偺幚岠抣偱, CStr(Value))
        End Set
    End Property
    Friend Property p儌乕僪偛偲偺弌尰夞悢() As Integer
        Get
            Return CInt(p儌乕僪偛偲偺弌尰夞悢_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            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
        Const PropName As String = "p儌乕僪偛偲偺弌尰夞悢"
        Static 壓, 抣, 忋 As Integer  '抣 = 僀儞僨僢僋僗丂1 to 5
        Dim a, n As Integer
        Static 僗僥僢僾悢Value() As Integer = {1, 5, 10, 20, 40, 90}  '僀儞僨僢僋僗偼 (1 to 5)  5 to 90 '偁傞儌乕僪偱僇乕僪傪愗傝懼偊傞夞悢偺嵟戝抣
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 壓 = 1 : 忋 = 5 : 抣 = 3
            Case gco僾儘僷Get : Return CStr(嘳悢抣斖埻Int(壓, 忋, 抣))
            Case gco僾儘僷Let : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
            Case gco僾儘僷Get尰嵼偺幚岠抣傪      'Get p儌乕僪偛偲偺弌尰夞悢Value
                Return CStr(僗僥僢僾悢Value(嘳悢抣斖埻Int(壓, 忋, 抣)))
            Case gco僾儘僷Let尰嵼偺幚岠抣偱      'Let p儌乕僪偛偲偺弌尰夞悢Value
                n = Val(s)
                For a = 壓 To 忋
                    If n <= 僗僥僢僾悢Value(a) Then
                        抣 = a : Exit For
                    End If
                Next
            Case gco僾儘僷MenuClick : 抣 = 嘳悢抣斖埻Int(壓, 忋, Val(s))
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷Let尰嵼偺幚岠抣偱, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僔儑乕僇乕僪僀儊乕僕() As Integer
        '0 = 儈僢僋僗        '1 = 暥帤        '2 = 傕傛偆        '3 = 夋憸
        Get
            Return CInt(p僔儑乕僇乕僪僀儊乕僕_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            Call p僔儑乕僇乕僪僀儊乕僕_RW(gco僾儘僷Let, CStr(Value))
        End Set
    End Property
    Friend Function p僔儑乕僇乕僪僀儊乕僕_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        '0 to 3  list box index
        '0  夋憸丄柾條丄暥帤
        '1  暥帤偩偗
        '2  傕傛偆偩偗
        '3  夋憸偩偗     
        Const PropName As String = "p僔儑乕僇乕僪僀儊乕僕" : Const 抣DEF As Integer = 0 : Static 抣 As Integer
        Dim 媽抣 As Integer = 抣
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = 抣DEF
            Case gco僾儘僷婯掕抣 : Return CStr(抣DEF)
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let
                Dim n As Integer = CInt(s)
                If n > 3 Then n = 0
                抣 = 嘳悢抣斖埻Int(0, 3, n)
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = 嘳悢抣斖埻Int(0, 3, CInt(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)))
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD
                If 媽抣 <> 抣 Then
                    gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
                End If
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p偡傋偰偺僇乕僪宆傪巊梡偡傞() As Boolean
        Get
            Return CBool(p偡傋偰偺僇乕僪宆傪巊梡偡傞_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Boolean)
            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
        Const PropName As String = "p偡傋偰偺僇乕僪宆傪巊梡偡傞" : Static 抣 As Boolean
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = True
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = CBool(s)
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = IIf(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s) = "True", True, False)
            Case gco僾儘僷MenuClick : 抣 = Not 抣
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾() As Boolean
        Get
            Return CBool(p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Boolean)
            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
        Const PropName As String = "p僇乕僪僔儑乕儖乕僾偺儌乕僪曄峏帪僋儕傾" : Static 抣 As Boolean
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : 抣 = True
            Case gco僾儘僷Get : Return CStr(抣)
            Case gco僾儘僷Let : 抣 = CBool(s)
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = IIf(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s) = "True", True, False)
            Case gco僾儘僷MenuClick : 抣 = Not 抣
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD, gco僾儘僷MenuClick
                gggbol = zzfrmDlg僇乕僪僔儑乕僆僾僔儑儞_偑_昞帵拞_側傜_偦傟偵_僾儘僷慖戰忬懺_傪_愝掕偡傞(PropName)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend ReadOnly Property p僔儑乕僇乕僪宆偡傋偰偺DEF() As String
        Get
            Return p僔儑乕僇乕僪宆_RW(gco僾儘僷婯掕抣)
        End Get
    End Property
    Friend Function p僔儑乕僇乕僪宆_巊梡拞_僇乕僪宆ID_Ary(ByRef wAry僇乕僪宆ID() As Integer) As Integer
        '攝楍偼侾儀乕僗偱曉偝傟傞偺偱拲堄偡傞偙偲丂丂return wAry僇乕僪宆ID ( 1  to  max )
        Dim sss As String = p僔儑乕僇乕僪宆巊梡拞
        If Left(sss, 1) = 惎 Then sss = Mid(sss, 2)
        Dim ary() As String = {""}
        Dim m As Integer = 嘳暥傪僇僢僩偟偰攝楍偵偡傞(sss, 惎, ary)
        ReDim wAry僇乕僪宆ID(m)
        For a As Integer = 1 To m
            wAry僇乕僪宆ID(a) = Val(ary(a))
        Next
        Return m
    End Function
    Friend Function p僔儑乕僇乕僪宆_巊梡拞偱偡(ByRef r僇乕僪宆IDX As Integer) As Boolean
        Return CBool(p僔儑乕僇乕僪宆_RW(30000, CStr(r僇乕僪宆IDX)))
    End Function
    Friend Property p僔儑乕僇乕僪宆巊梡拞() As String
        Get
            Return p僔儑乕僇乕僪宆_RW(gco僾儘僷Get)
        End Get
        Set(ByVal Value As String)
            Call p僔儑乕僇乕僪宆_RW(gco僾儘僷Let, Value)
        End Set
    End Property
    Friend Function p僔儑乕僇乕僪宆_巊梡曄峏(ByRef rAry僇乕僪_巊梡偡傞側傜True() As Boolean) As Boolean
        Return "" <> p僔儑乕僇乕僪宆_RW(31000, p僔儑乕僇乕僪宆_IndexStr_FromAry(rAry僇乕僪_巊梡偡傞側傜True))
    End Function
    Friend Function p僔儑乕僇乕僪宆_IndexStr_FromAry(ByRef rAry僇乕僪_巊梡偡傞側傜True() As Boolean) As String
        Dim a As Integer
        Dim sss As String = 惎
        For a = 0 To UBound(rAry僇乕僪_巊梡偡傞側傜True)
            sss = sss + IIf(rAry僇乕僪_巊梡偡傞側傜True(a), CStr(a) & 惎, "")
        Next
        Return sss
    End Function
    Friend Function p僔儑乕僇乕僪宆_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "", Optional ByRef 儐乕僓乕僇乕僪僞僀僩儖 As String = "") As String
        'Public Const c僇乕僪宆ALLmin As Integer = c巐妏宍  '0
        'Public Const c僇乕僪宆APPmax As Integer = c僴乕僩宍  '8
        'Private Const c僇乕僪宆USERmin As Integer = cUser0宍 '9
        'Private Const c僇乕僪宆Allmax As Integer = cUser7宍  '16     
        Const PropName As String = "p僔儑乕僇乕僪宆"
        Static 抣 As String '暥帤楍丂"仛0仛3.....仛5仛6仛11仛14仛...16仛"    'c僇乕僪宆ALLmin  to  c僇乕僪宆Allmax
        Dim a As Integer, t As String = ""
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔, gco僾儘僷婯掕抣, 102020, 102030  '僾儘僷弶婜壔  /  抣DEF偡傋偰  /  抣DEF傾僾儕  /  抣DEF儐乕僓乕  /  return  暥帤楍丂".....仛5仛6仛11仛14仛18仛19仛23...."
                Dim bol As Boolean = (僾儘僷僐儅儞僪 = gco僾儘僷弶婜壔) Or (僾儘僷僐儅儞僪 = gco僾儘僷婯掕抣)
                Dim stt As Integer = IIf(bol, ClsKanaKana.c僇乕僪宆ALLmin, IIf(僾儘僷僐儅儞僪 = 102020, ClsKanaKana.c僇乕僪宆ALLmin, ClsKanaKana.c僇乕僪宆USERmin))
                Dim stp As Integer = IIf(bol, ClsKanaKana.c僇乕僪宆Allmax, IIf(僾儘僷僐儅儞僪 = 102020, ClsKanaKana.c僇乕僪宆APPmax, ClsKanaKana.c僇乕僪宆Allmax))
                t = 惎
                For a = stt To stp : t = t & CStr(a) + 惎 : Next
                If 僾儘僷僐儅儞僪 = gco僾儘僷弶婜壔 Then
                    抣 = t
                Else
                    Return t
                End If
            Case gco僾儘僷Get
                Return 抣
            Case gco僾儘僷Let
                抣 = s
                If Len(抣) < 2 Or InStr(抣, 惎) = 0 Then 抣 = p僔儑乕僇乕僪宆偡傋偰偺DEF

                'p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX 偑丂壥偰尵偭偰偄側偄応崌偼丄p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX丂傪愭摢偵曄峏偡傞丅
                t = 惎 + CStr(p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX) + 惎
                If InStr(抣, t) = 0 Then
                    p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX = Val(Mid(抣, 2))   '"仛0仛3.....仛5仛6仛11仛14仛...16仛"  
                End If

                'qqqqq(CStr(p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX) & ", " & 抣)

                'non
            Case gco僾儘僷iniWR
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, 抣)
            Case gco僾儘僷iniRD
                gggstr = p僔儑乕僇乕僪宆_RW(gco僾儘僷Let, 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s), "")

                'Case 102040  'p僔儑乕僇乕僪宆僞僀僩儖(ByVal 僇乕僪宆IDX As Integer) 僇乕僪宆偺暥帤楍傪曉偡
                '    a = 嘳悢抣斖埻Int(ClsKanaKana.c僇乕僪宆ALLmin, ClsKanaKana.c僇乕僪宆Allmax, Val(s))
                '    Return m僇乕僪宆僨乕僞乕婎杮愝掕(a).儊僯儏乕僞僀僩儖
                'Case 202040    'p僔儑乕僇乕僪宆僞僀僩儖儐乕僓             GET  p僔儑乕僇乕僪宆_RW(202040, CStr(僇乕僪宆IDX))
                '    a = 嘳悢抣斖埻Int(ClsKanaKana.c僇乕僪宆USERmin, ClsKanaKana.c僇乕僪宆Allmax, Val(s))
                '    Return m僇乕僪宆僨乕僞乕婎杮愝掕(a).儊僯儏乕僞僀僩儖
                'Case 202041    'p僔儑乕僇乕僪宆僞僀僩儖儐乕僓             SET  p僔儑乕僇乕僪宆_RW(202041, CStr(僇乕僪宆IDX), 儐乕僓乕僇乕僪僞僀僩儖)
                '    a = 嘳悢抣斖埻Int(ClsKanaKana.c僇乕僪宆USERmin, ClsKanaKana.c僇乕僪宆Allmax, Val(s))
                '    m僇乕僪宆僨乕僞乕婎杮愝掕(a).儊僯儏乕僞僀僩儖 = Left(儐乕僓乕僇乕僪僞僀僩儖, 16)

            Case 30000     'p僔儑乕僇乕僪宆_巊梡拞偱偡(ByRef r僇乕僪宆IDX As Integer) 
                Return CStr(InStr(惎 + 抣, 惎 + s + 惎) > 0)
            Case 31000     'p僗僀僗僀僇乕僪宆_巊梡曄峏(ByRef rAry僇乕僪_巊梡偡傞側傜True() As Boolean)
                抣 = s
                If Len(抣) < 2 Or InStr(抣, 惎) = 0 Then 抣 = p僔儑乕僇乕僪宆_RW(gco僾儘僷婯掕抣)

        End Select
        Return 抣
    End Function
    '***********************************************************************
    Friend Function p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_NextSet() As Integer
        '偐側僇僫丂屌桳
        Return CInt(p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(125478))
    End Function
    Friend Property p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX() As Integer
        Get
            Return CInt(p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(gco僾儘僷Get))
        End Get
        Set(ByVal Value As Integer)
            Call p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(gco僾儘僷Let, CStr(Value))
        End Set
    End Property
    Private Function p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        'Public Const c僇乕僪宆ALLmin As Integer = c巐妏宍  '0
        'Public Const c僇乕僪宆APPmax As Integer = c僴乕僩宍  '8
        'Private Const c僇乕僪宆USERmin As Integer = cUser0宍 '9
        'Private Const c僇乕僪宆Allmax As Integer = cUser7宍  '16     
        Const PropName As String = "p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX"
        Static 抣 As Integer   'c巐妏宍=0   to   cUser7宍=16    
        Dim wAry僇乕僪宆ID(0) As Integer : Dim mmm As Integer : Dim a As Integer : Dim nnn As Integer
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Get, gco僾儘僷Let, 125478
                mmm = p僔儑乕僇乕僪宆_巊梡拞_僇乕僪宆ID_Ary(wAry僇乕僪宆ID)  'return wAry僇乕僪宆ID (  1  to  mmm  )
                If mmm = 0 Then
                    ReDim wAry僇乕僪宆ID(1) : wAry僇乕僪宆ID(1) = ClsKanaKana.c僇乕僪宆ALLmin  '0
                End If
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔
                If mmm < 0 Then 抣 = 0 Else 抣 = wAry僇乕僪宆ID(1)

            Case gco僾儘僷Get
                For a = 1 To mmm
                    If wAry僇乕僪宆ID(a) = 抣 Then Return CStr(抣)
                Next
                If mmm = 0 Then Return CStr(0) Else Return CStr(wAry僇乕僪宆ID(1))

            Case gco僾儘僷Let
                nnn = Val(s)
                抣 = 0
                For a = 1 To mmm
                    If wAry僇乕僪宆ID(a) = nnn Then
                        抣 = nnn : Exit For
                    End If
                Next
                If a > mmm Then
                    抣 = wAry僇乕僪宆ID(1)
                End If

            Case 125478
                'p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_NextSet   
                For a = 1 To mmm
                    If wAry僇乕僪宆ID(a) = 抣 Then
                        If a = mmm Then a = 1 Else a = a + 1
                        抣 = wAry僇乕僪宆ID(a)
                        Return CStr(抣)
                    End If
                Next
                '尰嵼偺丂抣丂偑丂p僔儑乕僇乕僪宆_巊梡拞丂帡側偄応崌偼
                Dim sss As String = p僔儑乕僇乕僪宆巊梡拞
                抣 = Val(Mid(sss, 2))  '"仛0仛3.....仛5仛6仛11仛14仛...16仛"  
                Return CStr(抣)

            Case gco僾儘僷iniWR
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))

            Case gco僾儘僷iniRD
                gggstr = p僔儑乕僇乕僪宆巊梡拞偺尰嵼偺IDX_RW(gco僾儘僷Let, 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s))

        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Private Const c儕僗僩偺怓攚宨 As Integer = 1
    Private Const c儕僗僩偺怓僇乕僪 As Integer = 2
    Private Const c儕僗僩偺偺怓僇乕僪榞 As Integer = 3
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    'Private Function p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_屇傃弌偟僒儞僾儖()
    '    p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨) = 0
    '    p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪) = 0
    '    p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞) = 0
    '    Dim a As Integer = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺怓攚宨)
    '    Dim b As Integer = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺怓僇乕僪)
    '    Dim c As Integer = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺偺怓僇乕僪榞)
    'End Function
    Friend ReadOnly Property p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(ByVal typIDX123 As Integer) As Integer
        Get
            Return CInt(p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(gco僾儘僷婯掕抣, typIDX123))
        End Get
    End Property
    Friend Property p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(ByVal typIDX123 As Integer) As Integer
        Get
            Return CInt(p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(gco僾儘僷Get, typIDX123))
        End Get
        Set(ByVal Value As Integer)
            Call p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(gco僾儘僷Let, typIDX123, CStr(Value))
        End Set
    End Property
    Friend Function p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByVal typIDX123 As Integer = 1, Optional ByRef s As String = "") As String
        Const PropName As String = "p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓" : Const cut As String = "," : Static 婯掕抣() As Integer = {0, 12648352, 21760, 4202751}  ' {0, &HDDEEFF&, &H4411FF&, &H6699FF&}
        Const 壓 As Integer = 1 : Const 忋 As Integer = 3 : Static 抣(忋) As Integer
        Dim typ As Integer = 嘳悢抣斖埻Int(壓, 忋, Val(typIDX123))
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔 : For a As Integer = 壓 To 忋 : 抣(a) = 婯掕抣(a) : Next
            Case gco僾儘僷婯掕抣 : Return CStr(婯掕抣(typ))
            Case gco僾儘僷Get : Return CStr(抣(typ))
            Case gco僾儘僷Let : 抣(typ) = CInt(嘳怓偺抣偺専嵏廋惓抣(Val(s)))
            Case gco僾儘僷iniWR
                Dim ww As String = CStr(抣(壓)) & cut & CStr(抣(壓 + 1)) & cut & CStr(抣(壓 + 2)) & cut
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, ww)
            Case gco僾儘僷iniRD
                Dim ary() As String = {""}
                Dim m As Integer = 嘳暥傪僇僢僩偟偰攝楍偵偡傞(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s), cut, ary, False)
                If m = 忋 Then
                    For a As Integer = 壓 To 忋
                        抣(a) = CInt(嘳怓偺抣偺専嵏廋惓抣(Val(ary(a))))
                    Next
                End If
        End Select
        Return "0"
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
#End Region

#Region "僀儀儞僩 from 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg ( 巐frmDlgUseCardSelect )"
    Friend Sub aa僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_Load_1_Disposed_2(ByVal op As Integer, ByVal rOwner As Form)
        Try
            Select Case op
                Case 1 'New Load
                    If gm傾僾儕廔椆偡傞 Then Return
                    If 1 = GMCOM_僟僀傾儘僌儌乕僪儗僗昞帵僠僃僢僋(僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg) Then
                        僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg = New 巐frmDlgUseCardSelect
                        僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.Owner = rOwner
                        僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.Show()
                    End If
                Case 2 'after Disposed
                    僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg = Nothing
            End Select
        Catch
            MsgBox(ErrorToString)
        End Try
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僂僀儞僪僂偺弶婜壔僨乕僞乕傪偔偩偝偄(ByRef wIsOK As Boolean, ByRef wMe_gmDlgID As Integer, ByRef w僟僀傾儘僌僥僉僗僩 As String, ByRef w巊梡栚揑儊僢僙乕僕 As String, ByRef w僞僥屄悢 As Integer, ByRef w巊梡屄悢_0_to_max As Integer, ByRef w傾僾儕宆_max As Integer, ByRef w僙儖暆 As Integer, ByRef w僙儖崅 As Integer, ByRef wCell娫僞僥儓僐 As Integer, ByRef w恾宍奜墢榞暆 As Integer, ByRef w恾宍奜墢榞怓 As Integer, ByRef w儕僗僩攚宨怓 As Integer, ByRef w慖戰怓 As Integer) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僂僀儞僪僂偺弶婜壔僨乕僞乕傪偔偩偝偄
        wIsOK = True
        wMe_gmDlgID = gmDlg僇乕僪僔儑乕僇乕僪宆傪愝掕
        w僟僀傾儘僌僥僉僗僩 = "僇乕僪僔儑乕偵巊梡偡傞僇乕僪宆偺慖戰"
        w巊梡栚揑儊僢僙乕僕 = "僇乕僪僔儑乕偵巊梡偡傞" & vbCrLf & "僇乕僪宆孮傪慖戰"
        w僞僥屄悢 = 4
        w巊梡屄悢_0_to_max = ClsKanaKana.c僇乕僪宆Allmax 'cUser7宍  '16     
        w傾僾儕宆_max = ClsKanaKana.c僇乕僪宆APPmax 'c僴乕僩宍  '8
        w僙儖暆 = 60
        w僙儖崅 = 60
        wCell娫僞僥儓僐 = 20
        w恾宍奜墢榞暆 = 1
        w儕僗僩攚宨怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨)
        w慖戰怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪) '
        w恾宍奜墢榞怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞) ' 
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇乕僪僨乕僞乕傪偔偩偝偄(ByRef wIsOK As Boolean, ByVal r僇乕僪宆IDX As Integer, ByVal r僙儖暆 As Integer, ByVal r僙儖崅 As Integer, ByRef w僇乕僪RGN_屇傃弌偟尦偱嶍彍偡傞 As Integer, ByRef w僇乕僪傪巊梡偟偰偄傞 As Boolean) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇乕僪僨乕僞乕傪偔偩偝偄
        w僇乕僪傪巊梡偟偰偄傞 = gooClsCardShow.p僔儑乕僇乕僪宆_巊梡拞偱偡(r僇乕僪宆IDX)
        Dim Rgn榞 As Integer = 0
        wIsOK = frmMain.oo偐側僇僫.aa僎乕儉僇乕僪宆儕乕僕儑儞傪嶌傞(False, r僇乕僪宆IDX, r僙儖暆, r僙儖崅, w僇乕僪RGN_屇傃弌偟尦偱嶍彍偡傞, Rgn榞, 0, 0, 0, 0)
        '-----------
        If Rgn榞 <> 0 Then DeleteObject(Rgn榞)
        Rgn榞 = 0
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇乕僪宆偺慖戰忬懺傪曄峏偟偰壓偝偄(ByRef wIsOK As Boolean, ByRef r僇乕僪慖戰僨乕僞乕() As Boolean) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇乕僪宆偺慖戰忬懺傪曄峏偟偰壓偝偄
        wIsOK = p僔儑乕僇乕僪宆_巊梡曄峏(r僇乕僪慖戰僨乕僞乕)
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇乕僪宆慖戰僟僀傾儘僌偐傜僐儅儞僪幚峴偺梫惪(ByRef wIsOK As Boolean, ByRef r僐儅儞僪 As Integer, ByRef r捛壛僨乕僞乕 As Integer) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇乕僪宆慖戰僟僀傾儘僌偐傜僐儅儞僪幚峴偺梫惪
        wIsOK = True
        Select Case r僐儅儞僪
            Case gccom傾僾儕廔椆
                Call frmMain.mn1game偙偺傾僾儕傪廔椆_Click(Nothing, Nothing)
            Case Else
                wIsOK = False
        End Select
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇乕僪枃悢偲僗僀僗僀儊僯儏乕傪巊梡偟傑偡偐(ByRef wIsOK As Boolean, ByRef w僇乕僪枃悢儊僯儏乕傪巊梡偡傞 As Boolean, ByRef w僗僀僗僀儊僯儏乕傪巊梡偡傞 As Boolean) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇乕僪枃悢偲僗僀僗僀儊僯儏乕傪巊梡偟傑偡偐
        wIsOK = True
        w僇乕僪枃悢儊僯儏乕傪巊梡偡傞 = False
        w僗僀僗僀儊僯儏乕傪巊梡偡傞 = False
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇乕僪枃悢巜掕Checked愝掕(ByRef wIsOK As Boolean, ByRef mnu僇乕僪枃悢_1 As System.Windows.Forms.ToolStripMenuItem, ByRef mnu僇乕僪枃悢_2 As System.Windows.Forms.ToolStripMenuItem, ByRef mnu僇乕僪枃悢_3 As System.Windows.Forms.ToolStripMenuItem, ByRef mnu僇乕僪枃悢_4 As System.Windows.Forms.ToolStripMenuItem, ByRef mnu僇乕僪枃悢_5 As System.Windows.Forms.ToolStripMenuItem) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇乕僪枃悢巜掕Checked愝掕
        'no op   other user
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇儔乕偑曄峏偝傟傑偟偨(ByVal rIndex As Integer, ByVal rColor As Integer) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇儔乕偑曄峏偝傟傑偟偨
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(rIndex) = rColor
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇儔乕傪偡傋偰尦偵栠偟側偝偄(ByVal rColor1stt As Integer, ByVal rColor2stt As Integer, ByVal rColor3stt As Integer, ByRef w儕僗僩攚宨怓 As Integer, ByRef w慖戰怓 As Integer, ByRef w恾宍奜墢榞怓 As Integer) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇儔乕傪偡傋偰尦偵栠偟側偝偄
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨) = rColor1stt
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪) = rColor2stt
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞) = rColor3stt
        w儕僗僩攚宨怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨)
        w慖戰怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪)
        w恾宍奜墢榞怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞)
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_僇儔乕傪婯掕抣偵儕僙僢僩偟側偝偄(ByRef w儕僗僩攚宨怓 As Integer, ByRef w慖戰怓 As Integer, ByRef w恾宍奜墢榞怓 As Integer) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.僇儔乕傪婯掕抣偵儕僙僢僩偟側偝偄
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺怓攚宨)
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺怓僇乕僪)
        p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺偺怓僇乕僪榞)
        w儕僗僩攚宨怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨)
        w慖戰怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪)
        w恾宍奜墢榞怓 = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞)
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_儊僯儏乕偺Enabled僨乕僞乕傪偔偩偝偄(ByRef w尦偵栠偡 As Boolean, ByRef w婯掕抣偵儕僙僢僩 As Boolean, ByVal rColor1stt As Integer, ByVal rColor2stt As Integer, ByVal rColor3stt As Integer) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.儊僯儏乕偺Enabled僨乕僞乕傪偔偩偝偄
        w尦偵栠偡 = Not ((p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨) = rColor1stt) And (p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪) = rColor2stt) And (p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞) = rColor3stt))
        w婯掕抣偵儕僙僢僩 = Not ((p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓攚宨) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺怓攚宨)) And (p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺怓僇乕僪) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺怓僇乕僪)) And (p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓(c儕僗僩偺偺怓僇乕僪榞) = p僇乕僪僔儑乕梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓DEF(c儕僗僩偺偺怓僇乕僪榞)))
    End Sub
    Private Sub 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg_懠偺僂僀儞僪僂偑昞帵偁傞偄偼旕昞帵偵側傝傑偟偨(ByVal rMe_gmDlgID As Integer, ByVal r昞帵曄峏僂僀儞僪僂ID As Integer, ByVal r昞帵True徚嫀False As Boolean, ByRef wRet_rMe_gmDlgID僂僀儞僪僂傪徚嫀偟側偝偄 As Boolean) Handles 僇乕僪僔儑乕梡僇乕僪宆愝掕Dlg.懠偺僂僀儞僪僂偑昞帵偁傞偄偼旕昞帵偵側傝傑偟偨
        wRet_rMe_gmDlgID僂僀儞僪僂傪徚嫀偟側偝偄 = GMCOM_Dlgs懠偺僂僀儞僪僂偺昞帵_旕昞帵僀儀儞僩偱_rMe_僂僀儞僪僂傪徚嫀偟側偝偄(rMe_gmDlgID, r昞帵曄峏僂僀儞僪僂ID, r昞帵True徚嫀False)
    End Sub
#End Region

#Region "僀儀儞僩 from 僇乕僪僔儑乕僆僾僔儑儞Dlg ( frmDlg僇乕僪僔儑乕僆僾僔儑儞 )"
    Friend Sub aa僇乕僪僔儑乕僆僾僔儑儞Dlg_Load_1_Disposed_2(ByVal op As Integer, ByVal rOwner As Form)
        Try
            Select Case op
                Case 1 'New Load
                    If gm傾僾儕廔椆偡傞 Then Return
                    If 1 = GMCOM_僟僀傾儘僌儌乕僪儗僗昞帵僠僃僢僋(僇乕僪僔儑乕僆僾僔儑儞Dlg) Then
                        僇乕僪僔儑乕僆僾僔儑儞Dlg = New frmDlg僇乕僪僔儑乕僆僾僔儑儞
                        僇乕僪僔儑乕僆僾僔儑儞Dlg.Owner = rOwner
                        僇乕僪僔儑乕僆僾僔儑儞Dlg.Show()
                    End If
                Case 2 'after Disposed
                    僇乕僪僔儑乕僆僾僔儑儞Dlg = Nothing
            End Select
        Catch
            MsgBox(ErrorToString)
        End Try
    End Sub
    Private Sub 僇乕僪僔儑乕僆僾僔儑儞Dlg_僟僀傾儘僌偺弶婜壔傪偟偰偔偩偝偄(ByRef wIsOK As Boolean, ByRef wMe_gmDlgID As Integer) Handles 僇乕僪僔儑乕僆僾僔儑儞Dlg.僟僀傾儘僌偺弶婜壔傪偟偰偔偩偝偄
        wIsOK = True
        wMe_gmDlgID = gmDlg僇乕僪僔儑乕僆僾僔儑儞
    End Sub
    Private Sub 僇乕僪僔儑乕僆僾僔儑儞Dlg_懠偺僂僀儞僪僂偑昞帵偁傞偄偼旕昞帵偵側傝傑偟偨(ByVal rMe_gmDlgID As Integer, ByVal r昞帵曄峏僂僀儞僪僂ID As Integer, ByVal r昞帵True徚嫀False As Boolean, ByRef wRet_rMe_gmDlgID僂僀儞僪僂傪徚嫀偟側偝偄 As Boolean) Handles 僇乕僪僔儑乕僆僾僔儑儞Dlg.懠偺僂僀儞僪僂偑昞帵偁傞偄偼旕昞帵偵側傝傑偟偨
        wRet_rMe_gmDlgID僂僀儞僪僂傪徚嫀偟側偝偄 = GMCOM_Dlgs懠偺僂僀儞僪僂偺昞帵_旕昞帵僀儀儞僩偱_rMe_僂僀儞僪僂傪徚嫀偟側偝偄(rMe_gmDlgID, r昞帵曄峏僂僀儞僪僂ID, r昞帵True徚嫀False)
    End Sub
#End Region

End Class

