Option Strict Off
Option Explicit On
Imports System.Windows.Forms
'------------------------------------ 2024/04/01 ------------------------------------
Public Class frmMain

#Region "愰尵"
    '********************************************************************************
    Private mNew幚峴拞 As Boolean = True
    Private Const cUser_Uro1_Poi2IDX As Short = 1
    '********************************************************************************
    Private m僼僅儞僩柤僼僅儞僩懢帤摨帪愝掕 As Boolean
    Private mMsDnX, mMsDnY As Integer
    Private tmpstr1() As String
    Private tmpstr2() As String
    '********************************************************************************
    Public oo僂儘僂儘 As New 屲clsUrouroPoipoi
    Private oo儐乕僓僇乕僪嶌惉 As 巐frmDlgUserCardMake = Nothing
    '********************************************************************************
    Public mIniReading, mFormSizeSeting As Boolean
    Public mMenuHight As Integer
    Public mmLoading As Boolean
    Private m僒僀僘僙僢僩嬛巭 As Boolean
    Public TimEventOnStr As String = ""
    Private mCallFromFormLoad As Boolean = False
    Private mCall_In_frmMain_ResizeEnd As Boolean = False
    Private mOldWndState As FormWindowState = FormWindowState.Normal
    Private m僂僀儞僪僂偑嵟戝嵟彫儌乕僪偑曄峏偝傟偨 As Boolean = False
    Private 儈僢僋僗儌乕僪愝掕Dlg As frmDlgModeSet
    Public WithEvents 僎乕儉梡僇乕僪宆愝掕Dlg As 巐frmDlgUseCardSelect
    Public WithEvents 怓偲僼僅儞僩偺愝掕Dlg As frmDlgColorFontSet
    Public 傾僀僐儞愝掕Dlg As frmDlgIconList
    Public mmpctICON_GDIBMP As Integer 'pctICON Bitmap GDI Handle 傾僾儕幚峴拞偼懚嵼偟懕偗傞
    '**************************************************************************************************************************************
    Private WithEvents 僀儀儞僩gAppEventMaker As 屲clsEventMaker
    '**************************************************************************************************************************************
    Private mMe_ResizeBegin_WD, mMe_ResizeBegin_HT As Integer
    Private mICONImage As Image = Nothing
    '********************************************************************************
    '2023/04/01  Module --> 屲bas僎乕儉愱梡嫟桳.GMCOM_僎乕儉寢壥僷僱儖昞帵_Show_Hide() 娭悢偺偨傔偺僟儈乕偺愰尵
    Public mn9枃悢偲帪娫偺昞帵 As ToolStripMenuItem, mn9巆傝枃悢 As ToolStripMenuItem, mn9宱夁帪娫 As ToolStripMenuItem
    '********************************************************************************
#End Region

#Region "AppIniFileOp"
    '仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴
    Friend Function aaAppIniFileOp(ByVal Load_0_QueryUnload_1_Resize_2_DoIniSave_3 As Long, ByRef rwIniDataStr() As String) As Boolean
        Return zzAppIniFileOp(Load_0_QueryUnload_1_Resize_2_DoIniSave_3, rwIniDataStr)
    End Function
    Private Function zzAppIniFileOp(ByVal Load_0_QueryUnload_1_Resize_2_DoIniSave_3 As Long, ByRef rwIniDataStr() As String) As Boolean
        '仧仧仧儊僀儞儂乕儉偵偺傒愝掕偡傞僐乕僪仧仧仧丂儊僀儞儂乕儉撪偐傜偺傒屇傃弌偟傑偡丅
        '撉弌偟帪偵丂INI 僼傽僀儖偑懚嵼偟側偄応崌偼丂False丂傪曉偟傑偡丅
        If gggAppIniFile Is Nothing Then Return False
        Try
            Dim RETVAL = False
            Dim Open0_Save1 As Long, opcode As Integer
            Open0_Save1 = Load_0_QueryUnload_1_Resize_2_DoIniSave_3
            With gggAppIniFile
                Select Case Open0_Save1
                    Case 0, 1
                        opcode = 0    'or ... 捛壛偱偒傞僐乕僪  ---> 屲clsAppINI.cAppIniCaption Or 屲clsAppINI.cAppIniBackColor Or 屲clsAppINI.cAppIniForeColor
                        RETVAL = gggAppIniFile.OpenSaveMain(Open0_Save1, Me.Name + "0012", Me, 屲clsAppINI.cAppIniFormPostSize Or opcode)  'or ... 捛壛偱偒傞僐乕僪  ---> , Text1, 屲clsAppINI.cAppIniText Or 屲clsAppINI.cAppIniTextSelSttLen Or 屲clsAppINI.cAppIniFontName Or 屲clsAppINI.cAppIniFontSize, List1, 屲clsAppINI.cAppIniList Or 屲clsAppINI.cAppIniListIndex, Check1, 屲clsAppINI.cAppIniValue,  ETC ........)
                        '******************************************************************************************************
                        gggint = gggAppIniFile.OpenSaveStrAry(Open0_Save1, Me.Name + "5522", Me, rwIniDataStr)
                        '******************************************************************************************************
                    Case 2
                        '偦傟偧傟偺僼僅乕儉偱丄埵抲偲僒僀僘偺僨乕僞乕傪曐懚偟傑偡丅
                        RETVAL = gggAppIniFile.FormSizeDataSetOnReSize(Me)
                End Select
                '******************************************************************************************************
                '儐乕僓乕傾僾儕偐傜柧帵揑偵 INI 僼傽僀儖傪曐懚偟傑偡丅
                If Open0_Save1 = 1 Then
                    gggint = gggAppIniFile.IniFileSaveDo
                End If
                '******************************************************************************************************
            End With
            Return RETVAL
        Catch
            MsgBox(ErrorToString)
        End Try
        Return False
    End Function
    '仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯
#End Region

    '********************************************************************************
    Friend Sub frmDlgUseCardSelect_User_s_DisPose(ByVal rMe_gmDlgID As Integer)
        '2023/05/28 new add
        If rMe_gmDlgID = gmDlg僂儘僂儘僎乕儉梡僇乕僪宆慖戰曄峏 Then
            Call aa僎乕儉梡僇乕僪宆愝掕Dlg_Load_1_Disposed_2(2, Nothing)
        End If
    End Sub
    '********************************************************************************

#Region "Form 僀儀儞僩"
    '********************************************************************************
    Public Sub New()
        mmLoading = True
        ' 偙偺屇傃弌偟偼丄Windows 僼僅乕儉 僨僓僀僫偱昁梫偱偡丅
        InitializeComponent()
        ' InitializeComponent() 屇傃弌偟偺屻偱弶婜壔傪捛壛偟傑偡丅
    End Sub
    '********************************************************************************
    Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        'qqqqq("仴 frmMain_FormClosing 仴仴仴仴仴仴仴仴仴仴")
        gm傾僾儕廔椆偡傞 = True
        Me.Cursor = Cursors.Default
        gggint = p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕傪撉崬()
        Dim IniDataStr() As String = {""}
        gggbol = aa僾儘僷僥傿弶婜壔_INI撉弌偟彂崬傒(gco僾儘僷iniWR, IniDataStr) '僾儘僷僥傿傪 INI 僼傽僀儖梡偺暥帤楍偵愝掕偡傞丅
        '---------------------------------------------------------------------------
        gggint = zzAppIniFileOp(1, IniDataStr)  '昁偢屇傃弌偟傑偡丅
        '---------------------------------------------------------------------------
        Call aa傾僀僐儞儕僗僩夋憸憖嶌(4, Nothing)
        Call p攝怓僨乕僞乕_RW(99, 0) 'delete brush
        Call oo僂儘僂儘.aa僎乕儉廔椆帪偺_BMP偲RGN偺嶍彍()
    End Sub
    Private Sub frmMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        gggbol = 嘳嘳嘳AppOwnHDC_make_del_in_AppMain_Form_Load_FormClose_傕偟僄儔乕側傜_End_偡傞(2)
        gAppEventMaker = Nothing
        gmComFileBmp = Nothing
    End Sub
    Private Sub frmMain_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
        'qqqqq("仠 frmMain_Disposed 仠仠仠仠仠仠仠仠仠仠仠仠仠仠仠仠仠仠")
    End Sub
    '********************************************************************************
    Private Sub frmMain_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
#If DEBUG Then
#Else
#End If
        '***********************************************************************
        mNew幚峴拞 = False
        '***********************************************************************
        If Not GMCOM傾僾儕MainForm弶婜壔_Pack(僀儀儞僩gAppEventMaker, Me, mmLoading, app僇乕僪孮椞堟嵟彫僒僀僘, mMenuHight, MainMenu1, Nothing, Nothing, Nothing, pct儊僀儞) Then End
        '***********************************************************************
        gm傾僾儕屌桳僋儔僗 = oo僂儘僂儘
        gggbol = oo僂儘僂儘.aa弶婜愝掕僆僽僕僃愝掕(1)
        '***********************************************************************
        If Not GMCOM傾僾儕MainForm_AppIniFile憖嶌(Me, mIniReading) Then End
        '***********************************************************************
        gggstr = oo僂儘僂儘.aaDlgFile僎乕儉梡_aa僂僀儞僪僂弶婜壔嶌惉_After_Ini_Read()
        '----------------------------------------
        mmLoading = False
        '----------------------------------------
        gggbol = 嘳Form_嵟彫壔忬懺側傜_昗弨僒僀僘偵栠偡(Me, m僒僀僘僙僢僩嬛巭)
        '----------------------------------------
        mCallFromFormLoad = True : Call frmMain_ResizeEnd(Nothing, Nothing) : mCallFromFormLoad = False
        '----------------------------------------
        Me.Cursor = New Cursor(Me.GetType(), "hand.CUR")
        gggbol = 嘳Forms_Controls_僪儔僢僌僪儘僢僾傪壜擻偵偡傞(Me, Nothing, Nothing, Nothing, Nothing)
        '----------------------------------------
        'MainMenu1.Visible = True
        pnl僎乕儉寢壥.SetBounds(0, MainMenu1.Height, 0, 0, BoundsSpecified.Location)
        '----------------------------------------
        gggbol = oo僂儘僂儘.aa暥帤僨乕僞乕婎杮攝楍偺愝掕()
        Call p攝怓僨乕僞乕傪慡偰偺幚懱偵愝掕(0)
        '--------------------------------
        pct尰嵼偺僇乕僪.Image = New Bitmap(pct儊僀儞.Image, 600, 600)
        pct尰嵼偺僇乕僪.SetBounds(0, 0, 200, 200, BoundsSpecified.Size)
        p尰嵼偺僇乕僪儃僢僋僗偺埵抲傪愝掕()
        '*************************************************************
        gmflag_FrmMain_LoadEnd = True  'aa攚宨偺愝掕() 掆巭僼儔僢僌
        '*************************************************************
        Call mn1gam僎乕儉僗僩僢僾_Click(Nothing, Nothing)
        '--------------------------------
        Call aa傾僀僐儞儕僗僩夋憸憖嶌(1, Nothing)
        '----------------------------------------
        gm傾僾儕廔椆偡傞 = False
        Call 僀儀儞僩gAppEventMaker.MakeEvent僎乕儉奐巒偲掆巭(False, "AppStart")
        Call 僀儀儞僩gAppEventMaker_MakeEvent僎乕儉攚宨夋憸偺昞帵ONOFF(gm傾僾儕屌桳僋儔僗.p僎乕儉攚宨夋憸傪昞帵BOOL)
        '----------------------------------------
        gggbol = GMCOM傾僾儕MainForm弶婜壔_Pack_2222(MainMenu1, mnbbb嵟戝壔, pnl僎乕儉寢壥)
        '----------------------------------------
        gggbol = zz僆乕僩儌乕僪Op(-1)
        '*************************************************************
        gggbol = 嘳Forms_嵟戝壔_昗弨壔_儊僯儏乕憖嶌(0, Me, mnbbb嵟戝壔)
        '*************************************************************
        gFormUnLoadDone = False
        '嘳Clipboard_SetImage_From_GDIBmp_Or_Image(0, pctICON.Image) 2023/03/24 OK
    End Sub

    Private Sub frmMain_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeBegin
        'qqqqq("仭frmMain_ResizeBegin")
        If mCall_In_frmMain_ResizeEnd Then Return
        If mmLoading Then Return
        mMe_ResizeBegin_WD = Me.Width
        mMe_ResizeBegin_HT = Me.Height
    End Sub

    Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        'qqqqq("仭frmMain_Resize")
        If mCall_In_frmMain_ResizeEnd Then Return
        If mmLoading Then Return
        If mOldWndState <> Me.WindowState Then
            m僂僀儞僪僂偑嵟戝嵟彫儌乕僪偑曄峏偝傟偨 = True
        End If
        If mMe_ResizeBegin_WD <> Me.Width Or mMe_ResizeBegin_HT <> Me.Height Then
            If pp僎乕儉幚峴拞 Then
                If pct儊僀儞.Visible Then pct儊僀儞.Visible = False
                If pct尰嵼偺僇乕僪.Visible Then pct尰嵼偺僇乕僪.Visible = True
            Else
                If pct儊僀儞.Visible Then pct儊僀儞.Visible = False
                If pct尰嵼偺僇乕僪.Visible Then pct尰嵼偺僇乕僪.Visible = False
            End If
            Me.BackColor = 嘳Color_from_INT(p攝怓僨乕僞乕攚宨怓)
            Me.Refresh()
            'qqqqq("仭frmMain_Resize() -->  Me.Refresh()")
        End If
        mOldWndState = Me.WindowState
    End Sub

    Private Sub frmMain_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
        'qqqqq("仭frmMain_SizeChanged")
        If mCall_In_frmMain_ResizeEnd Then Return
        If mmLoading Then Return
        If Me.WindowState = FormWindowState.Minimized Then Return
        If mOldWndState <> Me.WindowState Or m僂僀儞僪僂偑嵟戝嵟彫儌乕僪偑曄峏偝傟偨 Then
            Call frmMain_ResizeEnd(Nothing, Nothing)
            mOldWndState = Me.WindowState
            m僂僀儞僪僂偑嵟戝嵟彫儌乕僪偑曄峏偝傟偨 = False
            'qqqqq("frmMain_SizeChanged() -->  Call frmMain_ResizeEnd()")
        End If
    End Sub

    Private Sub frmMain_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd
        'qqqqq("仭frmMain_ResizeEnd")
        Static mOldWD, mOldHT As Integer : Static 僐僐偐傜屇傃弌偟偨 As Boolean
        '----------------------------------------
        If mmLoading = True Then Return
        If m僒僀僘僙僢僩嬛巭 Then Return
        If gm傾僾儕屌桳僋儔僗.DlgFile僎乕儉梡 Is Nothing Then Return
        If mIniReading Then Return
        If 僐僐偐傜屇傃弌偟偨 Then Return
        If Me.WindowState = FormWindowState.Minimized Then Return
        '----------------------------------------
        gggbol = 嘳FormSizeChang嵟彫僒僀僘埲忋偵_僼儔僌愝掕晅(mCall_In_frmMain_ResizeEnd, Me, mMenuHight, app僇乕僪孮椞堟嵟彫僒僀僘, app僇乕僪孮椞堟嵟彫僒僀僘, 僐僐偐傜屇傃弌偟偨)
        '----------------------------------------
        If Not mCallFromFormLoad Then
            If pp僎乕儉幚峴拞 Then
                If mOldWD <> Me.Width Or mOldHT <> Me.Height Or mOldWndState <> Me.WindowState Then
                    gm僂儘僂儘億僀億僀幚峴拞_FormReSize = True
                    gggbol = gm傾僾儕屌桳僋儔僗.aa嵞嶌惉儌乕僪偺愝掕(569, False)
                    pct尰嵼偺僇乕僪.Visible = True
                End If
            Else
                mn1gam僎乕儉僗僩僢僾_Click(Nothing, Nothing)
            End If
        End If
        gggint = p尰嵼偺僇乕僪儃僢僋僗偺埵抲傪愝掕()
        '----------------------------------------
        If mmLoading Then mmLoading = False
        '----------------------------------------
        gggint = zzAppIniFileOp(2, gggstrary)
        '----------------------------------------      
        mOldWD = Me.Width : mOldHT = Me.Height : mOldWndState = Me.WindowState
        '----------------------------------------
        'Static mmm As Integer : mmm = mmm + 1
        'qqqqq("仭仭frmMain_ResizeEnd " + Format(mmm, "0000"))
        'qqqqq("Form OLD WD/HT  = " + CStr(mOldWD) + ", " + CStr(mOldHT))
        'qqqqq("Form new WD/HT  = " + CStr(Me.Width) + ", " + CStr(Me.Height))
        'qqqqq("仭仭frmMain_ResizeEnd")
        'qqqqq("app僇乕僪孮椞堟嵟彫僒僀僘            = " & CStr(app僇乕僪孮椞堟嵟彫僒僀僘))
        'qqqqq("Form.ClientSize.Height - mMenuHight = " & CStr(Me.ClientSize.Height - mMenuHight))
        'qqqqq("Form.ClientSize.Width               = " & CStr(Me.ClientSize.Width))
        'qqqqq("Form.Height - Form.ClientSize.Height = " & CStr(Me.Height - Me.ClientSize.Height))
        'qqqqq("Form.Height - Form.ClientSize.Height + mMenuHight = " & CStr(Me.Height - Me.ClientSize.Height + mMenuHight))
        'qqqqq("Form.Width - Form.ClientSize.Width = " & CStr(Me.Width - Me.ClientSize.Width))
    End Sub

    Private Sub frmMain_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        Dim X As Integer = e.X
        Dim Y As Integer = e.Y
        Dim HITIDX As Integer = oo僂儘僂儘.aa儅僂僗僀儀儞僩(X, Y)
        'qqqqq(CStr(Y))
    End Sub

    Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        If mCall_In_frmMain_ResizeEnd Then Return
        If pp僎乕儉幚峴拞 Then Return

    End Sub
    '********************************************************************************
#End Region

#Region "僂僀儞僪僂偵僪儔僢僌僪儘僢僾偱僼傽僀儖捛壛"
    Private Sub frmMain_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragOver
        If oo僂儘僂儘.DlgFile僎乕儉梡.lbl嶍彍儌乕僪.Visible = True Then Return
        gggbol = 嘳OLEDragDrop僼傽僀儖僀儀儞僩_Drag_Is_巜掕EXT_IN(e, gco奼挘巕廤_夋憸)
    End Sub
    Private Sub frmMain_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
        If oo僂儘僂儘.DlgFile僎乕儉梡.lbl嶍彍儌乕僪.Visible = True Then Return
        Dim wFolders_0_Ubound() As String = {""} : Dim wFiles() As String = {""} : Dim wDrpX_inControl, wDrpY_inControl As Integer
        If 嘳OLEDragDrop僼傽僀儖僀儀儞僩(3, Me, e, wFolders_0_Ubound, wFiles, wDrpX_inControl, wDrpY_inControl) Then
            'qqqqq("wFolders_0_Ubound") : For a = 0 To UBound(wFolders_0_Ubound) : qqqqq(wFolders_0_Ubound(a)) : Next
            'qqqqq("wFiles_0_Ubound") : For a = 0 To UBound(wFiles_0_Ubound) : qqqqq(wFiles_0_Ubound(a)) : Next
            'qqqqq(CStr(wDrpX_inControl))
            'qqqqq(CStr(wDrpY_inControl))
        End If
        Dim max As Integer = 嘳暥攝楍傪僛儘儀乕僗偐傜堧儀乕僗偵偡傞(wFiles)
        gmFlag_On_OLEDropFile = True
        gggbol = oo僂儘僂儘.DlgFile僎乕儉梡.aa僼傽僀儖夋憸堦枃傪儕僗僩偵捛壛_on_DRAG_DROP_in_frmMain(wFiles)
        gmFlag_On_OLEDropFile = False
    End Sub
#End Region

#Region "儊僯儏乕 僀儀儞僩"
    '********************************************************************
    Friend Sub mn1gam僎乕儉傪奐巒_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn1gam僎乕儉傪奐巒.Click
        If gm傾僾儕廔椆偡傞 Then Return
        If Me.WindowState = FormWindowState.Minimized Then Return
        If TimEventOnStr = "僎乕儉幚峴拞_end_MakeLoop2" Then
        Else
            If pp僎乕儉幚峴拞 Then Exit Sub
        End If
        TimEventOnStr = "mn1gam僎乕儉傪奐巒_Click"
        TimEventOn.Enabled = True
    End Sub
    Private Sub TimEventOn_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TimEventOn.Tick
        TimEventOn.Enabled = False
        If Me.WindowState = FormWindowState.Minimized Then Return
        If gm傾僾儕廔椆偡傞 Then Return
        If mmLoading Then Return
        Select Case TimEventOnStr
            Case "mn1gam僎乕儉傪奐巒_Click"
                gggbol = oo僂儘僂儘.aa僎乕儉偺奐巒()
        End Select
        TimEventOnStr = ""
    End Sub
    '********************************************************************
    Friend Sub mn1gam僎乕儉僗僩僢僾_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn1gam僎乕儉僗僩僢僾.Click
        gggbol = oo僂儘僂儘.aa僎乕儉偺掆巭
        gggbol = oo僂儘僂儘.aa攚宨偺愝掕(True)
        pp僎乕儉幚峴拞 = False
        pp僎乕儉僋儕傾忬懺 = True
        gm僂儘僂儘億僀億僀幚峴拞_FormReSize = False
    End Sub
    '********************************************************************
    Private Sub mn1gam儈僢僋僗儌乕僪偺愝掕_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn1gam儈僢僋僗儌乕僪偺愝掕.Click
        Call aa僗僀僗僀僇乕僪宆愝掕Dlg_Load_1_Disposed_2(1, Me)
    End Sub
    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 frmDlgModeSet
                        With 儈僢僋僗儌乕僪愝掕Dlg
                            gggint = .Public_DlgID_Set(gmDlg僂儘僂儘儈僢僋僗儌乕僪愝掕)
                            .Show(Me)
                        End With
                    End If
                Case 2 'after Disposed
                    儈僢僋僗儌乕僪愝掕Dlg = Nothing
            End Select
        Catch
            MsgBox(ErrorToString)
        End Try
    End Sub
    '********************************************************************
    Private Sub mn1gam婎杮儌乕僪Do_1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn1gam婎杮儌乕僪Do_1.Click, mn1gam婎杮儌乕僪Do_2.Click, mn1gam婎杮儌乕僪Do_3.Click, mn1gam婎杮儌乕僪Do_4.Click, mn1gam婎杮儌乕僪Do_5.Click, mn1gam婎杮儌乕僪Do_6.Click, mn1gam婎杮儌乕僪Do_7.Click, mn1gam婎杮儌乕僪Do_8.Click
        If gm傾僾儕廔椆偡傞 Then Return
        Dim index As Integer = IIf(sender Is mn1gam婎杮儌乕僪Do_1, 1, IIf(sender Is mn1gam婎杮儌乕僪Do_2, 2, IIf(sender Is mn1gam婎杮儌乕僪Do_3, 3, IIf(sender Is mn1gam婎杮儌乕僪Do_4, 4, IIf(sender Is mn1gam婎杮儌乕僪Do_5, 5, IIf(sender Is mn1gam婎杮儌乕僪Do_6, 6, IIf(sender Is mn1gam婎杮儌乕僪Do_7, 7, IIf(sender Is mn1gam婎杮儌乕僪Do_8, 8, 0))))))))
        If index = 0 Then Return
        Call p婎杮儌乕僪_RW(gco僾儘僷MenuClick, index)
    End Sub
    '********************************************************************
    Friend Sub mn1game僇乕僪枃悢巜掕Do_ClickCOM(ByVal mnuIDX As Integer)
        If gm傾僾儕廔椆偡傞 Then Return
        If Not pp僎乕儉幚峴拞 Then
            Call mn1gam僎乕儉傪奐巒_Click(Nothing, Nothing)
            Call Sleep(300)
        End If
        Call oo僂儘僂儘.p僇乕僪枃悢_RW(gco僾儘僷MenuClick, CStr(mnuIDX))
    End Sub
    Private Sub mn1gam僇乕僪枃悢Do_1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn1gam僇乕僪枃悢Do_1.Click, mn1gam僇乕僪枃悢Do_2.Click, mn1gam僇乕僪枃悢Do_3.Click, mn1gam僇乕僪枃悢Do_4.Click, mn1gam僇乕僪枃悢Do_5.Click, mn1gam僇乕僪枃悢Do_6.Click, mn1gam僇乕僪枃悢Do_7.Click
        If gm傾僾儕廔椆偡傞 Then Return
        Dim index As Integer = IIf(sender Is mn1gam僇乕僪枃悢Do_1, 1, IIf(sender Is mn1gam僇乕僪枃悢Do_2, 2, IIf(sender Is mn1gam僇乕僪枃悢Do_3, 3, IIf(sender Is mn1gam僇乕僪枃悢Do_4, 4, IIf(sender Is mn1gam僇乕僪枃悢Do_5, 5, IIf(sender Is mn1gam僇乕僪枃悢Do_6, 6, IIf(sender Is mn1gam僇乕僪枃悢Do_7, 7, 0)))))))
        If index = 0 Then Return
        Call mn1game僇乕僪枃悢巜掕Do_ClickCOM(index)
    End Sub
    '********************************************************************
    Friend Sub mn1game偙偺傾僾儕傪廔椆_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn1game偙偺傾僾儕傪廔椆.Click
        gFormUnLoadDone = True
        gm傾僾儕廔椆偡傞 = True
        Me.Close()
    End Sub
    '********************************************************************
    Friend Sub mn3opt僆僾僔儑儞愝掕Dlg昞帵_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn3opt僆僾僔儑儞愝掕Dlg昞帵.Click
        Call gm傾僾儕屌桳僋儔僗.aa僂儘僂儘僆僾僔儑儞愝掕Dlg_Load_1_Disposed_2(1, Me)
    End Sub
    Private Sub mn3opt僎乕儉梡僇乕僪宆傪愝掕_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn3opt僎乕儉梡僇乕僪宆傪愝掕.Click
        Call aa僎乕儉梡僇乕僪宆愝掕Dlg_Load_1_Disposed_2(1, Me)
    End Sub
    Private Sub mn3opt僒僂儞僪愝掕Dlg昞帵_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn3opt僒僂儞僪愝掕Dlg昞帵.Click
        Call gm傾僾儕屌桳僋儔僗.mn3opt僒僂儞僪愝掕Dlg_Load_1_Disposed_2(1, Me)
    End Sub
    Private Sub mn3opt怓偲僼僅儞僩偺愝掕_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn3opt怓偲僼僅儞僩偺愝掕.Click
        Call aa怓偲僼僅儞僩偺愝掕Dlg_Load_1_Disposed_2(1, Me)
    End Sub
    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 frmDlgColorFontSet
                        gggstr = p攝怓僨乕僞乕_RW(336998)
                    End If
                Case 2 'after Disposed
                    怓偲僼僅儞僩偺愝掕Dlg = Nothing
            End Select
        Catch
            MsgBox(ErrorToString)
        End Try
    End Sub
    Private Sub mn3opt傾僀僐儞儌乕僪偺傾僀僐儞愝掕_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn3opt傾僀僐儞儌乕僪偺傾僀僐儞愝掕.Click
        If gm傾僾儕廔椆偡傞 Then Return
        If 1 = GMCOM_僟僀傾儘僌儌乕僪儗僗昞帵僠僃僢僋(傾僀僐儞愝掕Dlg) Then
            傾僀僐儞愝掕Dlg = New frmDlgIconList
        End If
        gggbol = 傾僀僐儞愝掕Dlg.aa僟僀傾儘僌Show1(Me, gmDlg傾僀僐儞愝掕Dlg, "傾僀僐儞儌乕僪偺傾僀僐儞愝掕")
    End Sub
    Private Sub mn3opt儐乕僓乕僇乕僪偺曇廤_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn3opt儐乕僓乕僇乕僪偺曇廤.Click
        If gm傾僾儕廔椆偡傞 Then Return
        If oo儐乕僓僇乕僪嶌惉 Is Nothing Then
            oo儐乕僓僇乕僪嶌惉 = New 巐frmDlgUserCardMake
            gggint = oo儐乕僓僇乕僪嶌惉.aaDlgShow(Me, 1.0!, 1.0!, 0.3!, "", 20, 520, 3, 3, 8)
        Else
            oo儐乕僓僇乕僪嶌惉.BringToFront()
        End If
    End Sub
    Friend Sub 儐乕僓乕僇乕僪偺曇廤_SetNothing()
        If oo儐乕僓僇乕僪嶌惉 IsNot Nothing Then
            oo儐乕僓僇乕僪嶌惉 = Nothing
        End If
    End Sub
    '********************************************************************
    Private Sub mn5攚宨夋憸偺摦偐偟曽_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn5攚宨夋憸偺摦偐偟曽.Click
        Call gm傾僾儕屌桳僋儔僗.aa攚宨夋憸儐儔儐儔愝掕Dlg_Load_1_Disposed_2(1, Me)
    End Sub
    Friend Sub mn5攚宨夋憸偺僼傽僀儖傪愝掕_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn5攚宨夋憸偺僼傽僀儖傪愝掕.Click
        If gm傾僾儕廔椆偡傞 Then Return
        gggbol = gm傾僾儕屌桳僋儔僗.aa僼傽僀儖夋憸僎乕儉梡DlgShow(Me)
    End Sub
    Private Sub mn5僎乕儉攚宨夋憸傪昞帵偡傞_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn5僎乕儉攚宨夋憸傪昞帵偡傞.Click
        Dim bol As Boolean = gm傾僾儕屌桳僋儔僗.p僎乕儉攚宨夋憸傪昞帵BOOL
        gm傾僾儕屌桳僋儔僗.p僎乕儉攚宨夋憸傪昞帵BOOL = Not bol
    End Sub
    Private Sub mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_1.Click, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_2.Click, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_3.Click, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_4.Click, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_5.Click
        If gm傾僾儕廔椆偡傞 Then Return
        If gm傾僾儕屌桳僋儔僗 Is Nothing Then Return
        Dim index As Integer = IIf(sender Is mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_1, 1, IIf(sender Is mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_2, 2, IIf(sender Is mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_3, 3, IIf(sender Is mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_4, 4, IIf(sender Is mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_5, 5, 0)))))
        If index = 0 Then Return
        gggbol = gm傾僾儕屌桳僋儔僗.mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_COM_Click(index)
    End Sub
    '********************************************************************
    Private Sub mn5僎乕儉攚宨夋憸傪師偺夋憸偵愗傝懼偊_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn5僎乕儉攚宨夋憸傪師偺夋憸偵愗傝懼偊.Click
        If gm傾僾儕廔椆偡傞 Then Return
        gggbol = gm傾僾儕屌桳僋儔僗.p僎乕儉攚宨夋憸偺愗傝懼偊_師偺夋憸偵_嫮惂揑偵
    End Sub
    '********************************************************************
    Private Sub mn9help巊梡曽朄傾僾儕愱梡_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn9help巊梡曽朄傾僾儕愱梡.Click
        Call 巐frmHelpWnd.aaHelpWndShow(Me, GMCOM傾僾儕僞僀僩儖("") & "丂偺僿儖僾", gm僿儖僾僼傽僀儖, gm僿儖僾僼傽僀儖CSS)
    End Sub
    Private Sub mn9help巊梡曽朄Web僽儔僂僓_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn9help巊梡曽朄Web僽儔僂僓.Click
        gggbol = 嘳FileRunOrFolderShow(CInt(Me.Handle), 0, gm僿儖僾僼傽僀儖)
    End Sub
    Private Sub mn9help僶乕僕儑儞忣曬_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mn9help僶乕僕儑儞忣曬.Click
        Dim dlg As New 巐frmDlgAbout
        dlg.AboutBoxShow(Me) '
        dlg.Dispose()
    End Sub
    '********************************************************************
    Private Sub mnaaa扵偡僇乕僪傪曄峏_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnaaa扵偡僇乕僪傪曄峏.Click
        If pp僎乕儉幚峴拞 Then Call oo僂儘僂儘.aa尰嵼偺僇乕僪傪嫮惂曄峏()
    End Sub
    '********************************************************************
    Private Sub mnbbb嵟戝壔_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnbbb嵟戝壔.Click
        mmLoading = True
        gggbol = 嘳Forms_嵟戝壔_昗弨壔_儊僯儏乕憖嶌(1, Me, mnbbb嵟戝壔)
        mmLoading = False
        Call frmMain_ResizeEnd(Nothing, Nothing)
    End Sub
    '********************************************************************
    Friend Sub mnuvvv偍傑偐偣_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuvvv偍傑偐偣.Click
        If Me.WindowState = FormWindowState.Minimized Then Return
        If pp僎乕儉幚峴拞 Then
            If Me.Enabled = False Then Return
            Dim X, Y As Integer
            Dim a As Integer = oo僂儘僂儘.aa尰嵼偺僇乕僪偺拞怱XY(X, Y)
            If a > 0 Then
                Y = Y + mMenuHight
                Dim HITIDX As Integer = oo僂儘僂儘.aa儅僂僗僀儀儞僩(X, Y)
            End If
        Else
            Beep()
        End If
    End Sub
    '********************************************************************
    Friend Function aa僆乕僩儌乕僪掆巭_傕偟幚峴拞偱偁傟偽(ByVal rErrFile As String) As Boolean
        Dim 僆乕僩儌乕僪拞 As Boolean = pnl僆乕僩儌乕僪.Visible
        If 僆乕僩儌乕僪拞 Then
            tim僆乕僩儌乕僪.Enabled = False
            gggbol = zz僆乕僩儌乕僪Op(9)
        End If
        Dim dlg As New frmDlgMsg僼傽僀儖僄儔乕
        gggbol = dlg.aaDlgShow1(Me, rErrFile, 僆乕僩儌乕僪拞)
        dlg.Dispose()
    End Function
    '********************************************************************
    Private Sub mnuwww僆乕僩儌乕僪奐巒_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuwww僆乕僩儌乕僪奐巒.Click, btn僆乕僩儌乕僪抶偔.Click, btn僆乕僩儌乕僪憗偔.Click, tim僆乕僩儌乕僪.Tick, btn僆乕僩儌乕僪掆巭.Click
        If gm傾僾儕廔椆偡傞 Then Return
        Dim index As Integer = IIf(sender Is mnuwww僆乕僩儌乕僪奐巒, 0, IIf(sender Is btn僆乕僩儌乕僪抶偔, 1, IIf(sender Is btn僆乕僩儌乕僪憗偔, 2, IIf(sender Is tim僆乕僩儌乕僪, 3, IIf(sender Is btn僆乕僩儌乕僪掆巭, 9, 100)))))
        If index = 100 Then Return
        'qqqqq("mnuwww僆乕僩儌乕僪奐巒_Click  etc ...")
        gggbol = zz僆乕僩儌乕僪Op(index)
    End Sub
    Private Function zz僆乕僩儌乕僪Op(ByVal op As Integer) As Boolean
        Static TVAL() As Integer = {400, 600, 900, 1400, 2000, 3000, 4500, 6000}
        Static idx As Integer  ' 0 to 7
        Dim tv As Integer = tim僆乕僩儌乕僪.Interval
        Select Case op
            Case 0 'mnuwww僆乕僩儌乕僪奐巒 ---- start
                pnl僆乕僩儌乕僪.Visible = True
                tim僆乕僩儌乕僪.Enabled = True
                Call mnuvvv偍傑偐偣_Click(Nothing, Nothing)
            Case 1 'btn抶偔_Click
                If idx < 7 Then idx = idx + 1
            Case 2 'btn憗偔_Click
                If idx > 0 Then idx = idx - 1
            Case 3 'timTimer_Tick
                Call mnuvvv偍傑偐偣_Click(Nothing, Nothing)
            Case -1, 4, 9   'form load   'Game End    'btn僆乕僩儌乕僪掆巭_Click
                pnl僆乕僩儌乕僪.Visible = False
                tim僆乕僩儌乕僪.Enabled = False
                If op = -1 Then 'form load  
                    idx = 3
                    pnl僆乕僩儌乕僪.SetBounds(0, Me.MainMenu1.Height, 0, 0, BoundsSpecified.Location)
                End If
        End Select
        Select Case op
            Case 0, 1, 2
                tim僆乕僩儌乕僪.Interval = TVAL(idx)
                lbl僆乕僩儌乕僪TimeSpan.Text = Format(tim僆乕僩儌乕僪.Interval / 1000, "0.0") & " 昩"
                btn僆乕僩儌乕僪憗偔.Enabled = (idx > 0)
                btn僆乕僩儌乕僪抶偔.Enabled = (idx < 7)
        End Select
        Dim v As Boolean = pp僎乕儉幚峴拞 And (Not pnl僆乕僩儌乕僪.Visible)
        mnuwww僆乕僩儌乕僪奐巒.Visible = v
        mnuvvv偍傑偐偣.Visible = v
        Return True
    End Function
    '********************************************************************
#End Region

#Region "僐儞僩儘乕儖 僀儀儞僩"
    '********************************************************************
    Private Sub pct尰嵼偺僇乕僪_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles pct尰嵼偺僇乕僪.DoubleClick
        Call mnaaa扵偡僇乕僪傪曄峏_Click(Nothing, Nothing)
    End Sub
    Private Sub pct尰嵼偺僇乕僪_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pct尰嵼偺僇乕僪.MouseDown
        Dim Button As Short = e.Button \ &H100000
        Dim Shift As Short = System.Windows.Forms.Control.ModifierKeys \ &H10000
        Dim X As Single = e.X
        Dim Y As Single = e.Y
        mMsDnX = X : mMsDnY = Y
    End Sub
    Private Sub pct尰嵼偺僇乕僪_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pct尰嵼偺僇乕僪.MouseMove
        Dim Button As Short = e.Button \ &H100000
        Dim Shift As Short = System.Windows.Forms.Control.ModifierKeys \ &H10000
        Dim X As Single = e.X
        Dim Y As Single = e.Y
        If mMsDnX > 0 And mMsDnY > 0 Then
            With pct尰嵼偺僇乕僪
                .SetBounds(.Left + X - mMsDnX, .Top + Y - mMsDnY, 0, 0, BoundsSpecified.X Or BoundsSpecified.Y)
            End With
        End If
    End Sub
    Private Sub pct尰嵼偺僇乕僪_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pct尰嵼偺僇乕僪.MouseUp
        Dim Button As Short = e.Button \ &H100000
        Dim Shift As Short = System.Windows.Forms.Control.ModifierKeys \ &H10000
        Dim X As Single = e.X
        Dim Y As Single = e.Y
        mMsDnX = -1 : mMsDnY = -1
        gggint = p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕傪撉崬()
        gggint = p尰嵼偺僇乕僪儃僢僋僗偺埵抲傪愝掕()
    End Sub
    '********************************************************************
    Private Sub tim僎乕儉帪娫_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tim僎乕儉帪娫.Tick
        With gm傾僾儕屌桳僋儔僗
            gggbol = 僎乕儉僨乕僞乕昞帵(1, .p僇乕僪枃悢CURVAL, .p僇乕僪枃悢_尰嵼偺巆傝枃悢)
        End With
    End Sub
    Friend Function 僎乕儉僨乕僞乕昞帵(ByVal r奐巒_0_搑拞_1_廔椆_2_弶婜壔_3 As Integer, ByVal m僗僞乕僩僇乕僪枃悢 As Integer, ByVal m尰嵼偺巆傝僇乕僪枃悢 As Integer) As Boolean
        Dim v As Boolean = (r奐巒_0_搑拞_1_廔椆_2_弶婜壔_3 = 2)
        If r奐巒_0_搑拞_1_廔椆_2_弶婜壔_3 <> 1 Then gggbol = GMCOM_僎乕儉寢壥僷僱儖昞帵_愗懼(IIf(v, 1, 2))
        Return 嘳僎乕儉枃悢_宱夁帪娫_昞帵張棟(r奐巒_0_搑拞_1_廔椆_2_弶婜壔_3, tim僎乕儉帪娫, m僗僞乕僩僇乕僪枃悢, m尰嵼偺巆傝僇乕僪枃悢, mnttt帪娫枃悢, lblMaisuu, lblTime)
    End Function
    '********************************************************************
#End Region

#Region "pnl僎乕儉寢壥"
    '***************************************************************************************************************
    'pnl僎乕儉寢壥丂傪丂徚偡
    Private Sub pnl僎乕儉寢壥_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pnl僎乕儉寢壥.Click, lblHed.Click, lblMaisuu.Click, lblTime.Click
        gggbol = GMCOM_僎乕儉寢壥僷僱儖昞帵_愗懼(2)
    End Sub
    '***************************************************************************************************************
#End Region

#Region "娭悢丂奜晹僀儞僞乕僼僃僀僗"
    Friend Function frmMain_Refresh_BackColor() As Boolean
        If pp僎乕儉僋儕傾忬懺 Then
            If pct儊僀儞.Visible Then pct儊僀儞.Visible = False
            Me.BackColor = 嘳Color峔憿懱_from_怓抣(p攝怓僨乕僞乕攚宨怓)
            Me.Invalidate()
            Me.Refresh()
        Else
            '僎乕儉幚峴拞偼丄儖乕僾撪偱攚宨怓偑愝掕偝傟傞丅
        End If
    End Function
    Friend Function aaCallCheck嵞嶌惉儌乕僪偺愝掕(ByRef 抣 As Integer, ByRef old抣 As Integer, ByRef 僾儘僷僐儅儞僪 As Integer) As Boolean
        aaCallCheck嵞嶌惉儌乕僪偺愝掕 = (old抣 <> 抣 And 僾儘僷僐儅儞僪 = gco僾儘僷Let And mmLoading = False)
    End Function
    Friend Function aaCallCheck嵞嶌惉儌乕僪偺愝掕(ByRef 抣 As Single, ByRef old抣 As Single, ByRef 僾儘僷僐儅儞僪 As Integer) As Boolean
        aaCallCheck嵞嶌惉儌乕僪偺愝掕 = (old抣 <> 抣 And 僾儘僷僐儅儞僪 = gco僾儘僷Let And mmLoading = False)
    End Function
    Friend Function aaCallCheck嵞嶌惉儌乕僪偺愝掕(ByRef 抣 As String, ByRef old抣 As String, ByRef 僾儘僷僐儅儞僪 As Integer) As Boolean
        aaCallCheck嵞嶌惉儌乕僪偺愝掕 = (old抣 <> 抣 And 僾儘僷僐儅儞僪 = gco僾儘僷Let And mmLoading = False)
    End Function
    Friend Function aaCallCheck嵞嶌惉儌乕僪偺愝掕(ByRef 抣 As String, ByRef old抣 As String) As Boolean
        aaCallCheck嵞嶌惉儌乕僪偺愝掕 = (old抣 <> 抣 And mmLoading = False)
    End Function
    Friend Function aa傕偟僎乕儉掆巭忬懺側傜_夋柺僋儕傾() As Boolean
        '僟儈乕娭悢丂no op
    End Function

    Friend Function aa嵞嶌惉儌乕僪偺愝掕(ByRef r嵞嶌惉 As Integer) As Boolean
        Return gm傾僾儕屌桳僋儔僗.aa嵞嶌惉儌乕僪偺愝掕(r嵞嶌惉)
    End Function

    Friend Function aaDlgCardRgnMakeIO(ByRef op As Integer, Optional ByRef rw巊梡僇乕僪孮 As String = "", Optional ByRef DlgList As System.Windows.Forms.ListBox = Nothing, Optional ByRef 僇乕僪宆 As Integer = 0, Optional ByRef 僇乕僪WDHT As Integer = 0, Optional ByRef 榞暆幚悺 As Integer = 0, Optional ByRef Rgn夋 As Integer = 0, Optional ByRef Rgn榞 As Integer = 0, Optional ByRef w僇乕僪暆 As Integer = 0, Optional ByRef w僇乕僪崅 As Integer = 0, Optional ByRef wRgn夋DefUser As Integer = 0, Optional ByRef wRgn榞DefUser As Integer = 0, Optional ByRef w僇乕僪暆DefUser As Integer = 0, Optional ByRef w僇乕僪崅DefUser As Integer = 0) As Integer
        aaDlgCardRgnMakeIO = 0
        Select Case op
            'Case 112233
            '    aaDlgCardRgnMakeIO = 嶰fCardGameDlgCardRgnMake.aaDlgShow1(Me, 0.8, 1.2, oo僂儘僂儘.aa儐乕僓乕僇乕僪僿僢僪暥帤楍, 12, 8130) 'from --- mnu儐乕僓乕僇乕僪偺曇廤_Click()  --- DlgShow
            Case 2000, 2002, 2009 : aaDlgCardRgnMakeIO = oo僂儘僂儘.aa儐乕僓乕僇乕僪嶌惉屻偵僇乕僪傪忋彂偒曐懚(op, rw巊梡僇乕僪孮, DlgList, 僇乕僪宆, 僇乕僪WDHT, 榞暆幚悺, Rgn夋, Rgn榞, w僇乕僪暆, w僇乕僪崅, wRgn夋DefUser, wRgn榞DefUser, w僇乕僪暆DefUser, w僇乕僪崅DefUser)
            Case 10020, 10021, 10022, 10023 : aaDlgCardRgnMakeIO = oo僂儘僂儘.aa儐乕僓乕僇乕僪傪昗弨偵栠偡僐儅儞僪(op, rw巊梡僇乕僪孮, DlgList, 僇乕僪宆, 僇乕僪WDHT, 榞暆幚悺, Rgn夋, Rgn榞, w僇乕僪暆, w僇乕僪崅, wRgn夋DefUser, wRgn榞DefUser, w僇乕僪暆DefUser, w僇乕僪崅DefUser)
        End Select
    End Function

    Friend Function aaDlgCardRgnMakeIOEX(ByRef rOld僇乕僪宆 As Integer, ByRef r儊僯儏乕僞僀僩儖 As String, ByRef r儊僯儏乕偵昞帵 As Boolean, ByRef r廲墶斾棪 As Single, ByRef r婎弨偺攞悢抣墶 As Single, ByRef r婎弨偺攞悢抣廲 As Single, ByRef r億儕僑儞梫慺悢 As Integer, ByRef r億儕僑儞() As POINTAPI, ByRef rUserCardMakeBox僗働乕儖婎悢WD As Integer, ByRef rUserCardMakeBox僗働乕儖婎悢HT As Integer) As Boolean
        aaDlgCardRgnMakeIOEX = oo僂儘僂儘.aa僇乕僪嶌惉僨乕僞乕愝掕(rOld僇乕僪宆, r儊僯儏乕僞僀僩儖, r儊僯儏乕偵昞帵, r廲墶斾棪, r婎弨偺攞悢抣墶, r婎弨偺攞悢抣廲, r億儕僑儞梫慺悢, r億儕僑儞, rUserCardMakeBox僗働乕儖婎悢WD, rUserCardMakeBox僗働乕儖婎悢HT)
    End Function

    Friend Function aa傾僀僐儞儕僗僩夋憸憖嶌(ByRef op As Integer, ByRef pct As PictureBox) As Boolean
        Static mChanged As Boolean
        Dim f As String
        Select Case op
            Case 1 'App start
                mChanged = False
                f = GMCOM傾僾儕僼僅儖僟("\") & app傾僀僐儞儕僗僩夋憸僼傽僀儖
                If 嘳僼傽僀儖偼懚嵼(f) Then
                    gggbol = 嘳ImageFileOpen_Copy_Into_OtherImage(f, mICONImage)
                Else
                    MsgBox("夋憸僼傽僀儖丂" & f & "偑懚嵼偟傑偣傫" & gggCR2 & "傾僀僐儞傪巊梡偡傞儌乕僪偱僄儔乕偑敪惗偟傑偡")
                    mICONImage = pct儊僀儞.Image.Clone
                End If
                Dim bmp As Bitmap = mICONImage
                mmpctICON_GDIBMP = bmp.GetHbitmap

            Case 2 'from frmDlgIconSet Form Start
                gggbol = 嘳Image_Copy_or_Clone(pct.Image, mICONImage)
                pct.Refresh()

            Case 3 'from frmDlgIconSet btn愝掕傪桳岠偵偟偰暵偠傞_Click On Dlg Close  If Changed ...
                mChanged = True
                gggbol = 嘳Image_Copy_or_Clone(mICONImage, pct.Image)
                If mmpctICON_GDIBMP <> 0 Then DeleteObject(mmpctICON_GDIBMP)
                mmpctICON_GDIBMP = 0
                Dim bmp As Bitmap = mICONImage
                mmpctICON_GDIBMP = bmp.GetHbitmap

            Case 4 'On App End
                If mmpctICON_GDIBMP <> 0 Then DeleteObject(mmpctICON_GDIBMP)
                mmpctICON_GDIBMP = 0
                If mICONImage IsNot Nothing Then
                    f = GMCOM傾僾儕僼僅儖僟("\") & app傾僀僐儞儕僗僩夋憸僼傽僀儖
                    If mChanged Then
                        Try
                            mICONImage.Save(f)
                        Catch ex As Exception
                            MsgBox("ERROR   mICONImage.Save(f)")
                        End Try
                    End If
                    mICONImage.Dispose()
                    mICONImage = Nothing
                End If
                mChanged = False

            Case 5 'from frmDlgIconSet btn傾僾儕偺婯掕偵栠偡_Click
                mChanged = False
                f = GMCOM傾僾儕僼僅儖僟("\") & app傾僀僐儞儕僗僩夋憸僼傽僀儖DEF
                If 嘳僼傽僀儖偼懚嵼(f) Then
                    gggbol = 嘳ImageFileOpen_Copy_Into_OtherImage(f, mICONImage)
                Else
                    MsgBox("傾僾儕婯掕偺夋憸僼傽僀儖丂" & f & "偑懚嵼偟傑偣傫")
                    Return False
                End If
                Dim bmp As Bitmap = mICONImage
                mmpctICON_GDIBMP = bmp.GetHbitmap
                gggbol = aa傾僀僐儞儕僗僩夋憸憖嶌(2, pct)
                mChanged = True

        End Select
        Return True
    End Function

#End Region

#Region "p僾儘僷僥傿娭楢"
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa儊僯儏乕僆僽僕僃愝掕(ByRef 僾儘僷 As String, ByRef 儊僰() As System.Windows.Forms.ToolStripMenuItem, ByRef 壓 As Integer, ByRef 忋 As Integer) As Boolean
        Dim a As Integer
        Select Case 僾儘僷
            Case "p僇乕僪枃悢"
                a = 嘳儊僯儏乕攝楍嶌惉_1_20(儊僰, mn1gam僇乕僪枃悢Do_1, mn1gam僇乕僪枃悢Do_2, mn1gam僇乕僪枃悢Do_3, mn1gam僇乕僪枃悢Do_4, mn1gam僇乕僪枃悢Do_5, mn1gam僇乕僪枃悢Do_6, mn1gam僇乕僪枃悢Do_7)
                壓 = 1 : 忋 = UBound(儊僰)
            Case "p婎杮儌乕僪"
                a = 嘳儊僯儏乕攝楍嶌惉_1_20(儊僰, mn1gam婎杮儌乕僪Do_1, mn1gam婎杮儌乕僪Do_2, mn1gam婎杮儌乕僪Do_3, mn1gam婎杮儌乕僪Do_4, mn1gam婎杮儌乕僪Do_5, mn1gam婎杮儌乕僪Do_6, mn1gam婎杮儌乕僪Do_7, mn1gam婎杮儌乕僪Do_8)
                壓 = 1 : 忋 = UBound(儊僰)
            Case "p僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘"
                a = 嘳儊僯儏乕攝楍嶌惉_1_20(儊僰, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_1, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_2, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_3, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_4, mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘Do_5)
                壓 = 1 : 忋 = UBound(儊僰)
            Case "p僎乕儉攚宨夋憸傪昞帵"
                壓 = 1 : 忋 = 1 : ReDim 儊僰(忋) : 儊僰(1) = mn5僎乕儉攚宨夋憸傪昞帵偡傞
        End Select
        Return True
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function aa僾儘僷僥傿弶婜壔_INI撉弌偟彂崬傒(ByRef 僾儘僷僐儅儞僪 As Integer, ByRef ini攝楍() As String) As Boolean
        Dim CurIDX As Integer
        Dim ssss As String, hedend As String = "*********************" + "僾儘僷僥傿 in frmMain" + "*********************"
        Dim 攝楍忋尷 As Integer = 1000
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔
                Call p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(僾儘僷僐儅儞僪, gggintary)
                Call p婎杮儌乕僪_RW(僾儘僷僐儅儞僪)
                Call p僼僅儞僩柤_RW(僾儘僷僐儅儞僪)
                Call p僼僅儞僩懢帤_RW(僾儘僷僐儅儞僪)
                Call p攝怓僨乕僞乕_RW(僾儘僷僐儅儞僪)
                Call p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW(僾儘僷僐儅儞僪)
                Call p僎乕儉梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(僾儘僷僐儅儞僪)

            Case gco僾儘僷iniRD
                Const ads As String = "="
                Dim Hedp婎杮儌乕僪偺儈僢僋僗儌乕僪_RW As String = p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(gco僾儘僷柤, gggintary) + 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
                For CurIDX = 1 To UBound(ini攝楍)
                    ssss = ini攝楍(CurIDX)
                    If InStr(ssss, Hedp婎杮儌乕僪偺儈僢僋僗儌乕僪_RW) = 1 Then
                        Call p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(僾儘僷僐儅儞僪, gggintary, 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(僾儘僷僐儅儞僪, 0, ssss)
                    ElseIf InStr(ssss, Hedp尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW) = 1 Then
                        Call p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW(僾儘僷僐儅儞僪, ssss)
                    ElseIf InStr(ssss, Hedp僎乕儉梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW) = 1 Then
                        Call p僎乕儉梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(僾儘僷僐儅儞僪, 1, ssss)
                    End If
                Next
            Case gco僾儘僷iniWR
                ReDim ini攝楍(攝楍忋尷)
                CurIDX = 0
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = "" Else GoTo exitpos_gco僾儘僷iniWR
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = "Use In aa僾儘僷僥傿弶婜壔_INI撉弌偟彂崬傒()" Else GoTo exitpos_gco僾儘僷iniWR
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = "仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭 DataStart 仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭" Else GoTo exitpos_gco僾儘僷iniWR
                '----------------------------------------------------------------------
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = hedend Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(僾儘僷僐儅儞僪, gggintary) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p婎杮儌乕僪_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p僼僅儞僩柤_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p僼僅儞僩懢帤_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p攝怓僨乕僞乕_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = p僎乕儉梡僇乕僪宆傪愝掕僟僀傾儘僌偺怓_RW(僾儘僷僐儅儞僪) Else Return True
                CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = hedend Else Return True
                '----------------------------------------------------------------------
        End Select
        gggbol = oo僂儘僂儘.aa僾儘僷僥傿弶婜壔_INI撉弌偟彂崬傒sub(僾儘僷僐儅儞僪, ini攝楍, CurIDX)
        If 僾儘僷僐儅儞僪 = gco僾儘僷iniWR Then
            CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = "仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭 DataEnd 仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭"
            CurIDX = CurIDX + 1 : If CurIDX <= 攝楍忋尷 Then ini攝楍(CurIDX) = ""
            ReDim Preserve ini攝楍(CurIDX)
        End If
exitpos_gco僾儘僷iniWR:
        ReDim Preserve ini攝楍(CurIDX) : Return True
        Return True
    End Function

#End Region

#Region "p僾儘僷僥傿"
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    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婎杮儌乕僪儊僯儏乕僥僉僗僩SET(ByVal 儈僢僋僗儌乕僪 As String) As Boolean
        Call p婎杮儌乕僪_RW(125544, 儈僢僋僗儌乕僪)
        Return True
    End Function
    Private Function p婎杮儌乕僪_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        Const PropName As String = "p婎杮儌乕僪" : Const 婎杮儌乕僪儈僢僋僗儌乕僪偺儊儞僶婰崋 As String = "亄"
        Static 壓, 抣, 忋 As Integer : Static 儊僰(0) As ToolStripMenuItem : Dim a, old抣 As Integer
        old抣 = 抣
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔
                抣 = 1 : Call aa儊僯儏乕僆僽僕僃愝掕(PropName, 儊僰, 壓, 忋)
            Case gco僾儘僷婯掕抣
                Return CStr(1)
            Case gco僾儘僷Get
                Return CStr(抣)
            Case gco僾儘僷Let, 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))) '0 - idxMAX
            Case 125544 'p婎杮儌乕僪儊僯儏乕僥僉僗僩SET(s = "01101011")
                If UBound(儊僰) = 0 Then Return ""
                Dim ttt As String, bol As Boolean, nnn As Integer
                For a = 2 To Len(s)
                    If a > 壓 And a <= 忋 Then
                        ttt = 儊僰(a).Text
                        bol = (Mid(s, a, 1) = "1")
                        nnn = InStr(ttt, 婎杮儌乕僪儈僢僋僗儌乕僪偺儊儞僶婰崋)
                        If bol And nnn = 0 Then
                            儊僰(a).Text = 婎杮儌乕僪儈僢僋僗儌乕僪偺儊儞僶婰崋 & ttt
                        ElseIf (Not bol) And nnn > 0 And Len(ttt) > 2 Then
                            儊僰(a).Text = Mid(ttt, 2)
                        End If
                    Else
                        Exit For
                    End If
                Next
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷MenuClick, gco僾儘僷iniRD
                If UBound(儊僰) = 0 Then
                Else
                    For a = 壓 To 忋 : 儊僰(a).Checked = (抣 = a) : Next
                    If 僾儘僷僐儅儞僪 = gco僾儘僷MenuClick Then Call gm傾僾儕屌桳僋儔僗.aa嵞嶌惉儌乕僪偺愝掕(2)
                    If old抣 <> 抣 Then
                        Call 僀儀儞僩gAppEventMaker.MakeEvent_p婎杮儌乕僪偑曄峏偝傟傑偟偨(抣)
                    End If
                End If
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p婎杮儌乕僪偺儈僢僋僗儌乕僪傪弶婜壔() As String
        Return p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(gco僾儘僷弶婜壔, gggintary)
    End Function
    Friend ReadOnly Property p婎杮儌乕僪偺儈僢僋僗儌乕僪偺儌乕僪悢() As Integer
        Get
            Return CInt(p婎杮儌乕僪偺儈僢僋僗儌乕僪IDXS(gggintary))
        End Get
    End Property
    Friend Function p婎杮儌乕僪偺儈僢僋僗儌乕僪IDXS_GETARY(ByRef Indexs() As Integer) As Integer
        Return CInt(p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(3, Indexs))
    End Function
    Friend Property p婎杮儌乕僪偺儈僢僋僗儌乕僪() As String
        Get
            Return p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(gco僾儘僷Get, gggintary)
        End Get
        Set(ByVal Value As String)
            Call p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(gco僾儘僷Let, gggintary, Value)
        End Set
    End Property
    Friend Property p婎杮儌乕僪偺儈僢僋僗儌乕僪IDXS(ByVal Indexs() As Integer) As Integer
        Get
            Return CInt(p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(3, Indexs))
        End Get
        Set(ByVal Value As Integer)
            Call p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(4, Indexs)
        End Set
    End Property
    Friend Function p婎杮儌乕僪偺儈僢僋僗儌乕僪曄峏幚峴() As String
        Return p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(976824, gggintary)
    End Function
    Private Function p婎杮儌乕僪偺儈僢僋僗儌乕僪_RW(ByRef 僾儘僷僐儅儞僪 As Integer, ByRef Indexs() As Integer, Optional ByRef s As String = "") As String
        Const PropName As String = "p婎杮儌乕僪偺儈僢僋僗儌乕僪" : Const mmmDEF As String = "01111111" : Const maxIDX As Integer = 8
        Static mmmCUR As String = mmmDEF
        Dim a, m As Integer
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔
                mmmCUR = mmmDEF
                gggbol = p婎杮儌乕僪儊僯儏乕僥僉僗僩SET(mmmCUR)
            Case gco僾儘僷婯掕抣
                Return mmmDEF
            Case gco僾儘僷Get
                Return mmmCUR
            Case gco僾儘僷iniWR
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, mmmCUR)
            Case gco僾儘僷iniRD
                mmmCUR = 嘳VBStrLeft(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s) & mmmDEF, maxIDX)
                gggbol = p婎杮儌乕僪儊僯儏乕僥僉僗僩SET(mmmCUR)
                '----------------------------------------------------------------------------
                'Indexs()丂偼奺儊僯儏乕偺僀儞僨僢僋僗偲懳墳偟偰丄巊梡偡傞傕偺偼 1 偦傟埲奜偼 0 傪愝掕偡傞丅
                '----------------------------------------------------------------------------
            Case 3 'Get p婎杮儌乕僪偺儈僢僋僗儌乕僪IDXS
                If Len(mmmCUR) <> maxIDX Then mmmCUR = mmmDEF
                ReDim Indexs(maxIDX)
                m = 0
                For a = 1 To maxIDX
                    If Mid(mmmCUR, a, 1) <> "0" Then
                        Indexs(a) = 1 : m = m + 1
                    Else
                        Indexs(a) = 0
                    End If
                Next
                Return CStr(m)
                '----------------------------------------------------------------------------
            Case 4 'Let p婎杮儌乕僪偺儈僢僋僗儌乕僪IDXS
                If UBound(Indexs) = maxIDX Then
                    mmmCUR = ""
                    For a = 1 To maxIDX
                        mmmCUR = mmmCUR & IIf(Indexs(a) <> 0, "1", "0")
                    Next
                End If
                gggbol = p婎杮儌乕僪儊僯儏乕僥僉僗僩SET(mmmCUR)
                '----------------------------------------------------------------------------
            Case 976824 'call from p婎杮儌乕僪偺儈僢僋僗儌乕僪曄峏幚峴
                If p婎杮儌乕僪 <> 1 Then p婎杮儌乕僪 = 1
                With gm傾僾儕屌桳僋儔僗
                    Call .aa暥帤僨乕僞乕婎杮攝楍偺愝掕(False)
                    Call .aa暥帤僨乕僞乕巊梡攝楍偺愝掕(.p僇乕僪枃悢CURVAL, 0)
                    Call .aa嵞嶌惉儌乕僪偺愝掕(9)
                End With
        End Select
        Return mmmCUR
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Property p攝怓僨乕僞乕攚宨怓pct尰嵼偺僇乕僪() As Integer
        Get
            Return CInt(p攝怓僨乕僞乕_RW(gco僾儘僷Get, 2))
        End Get
        Set(ByVal Value As Integer)
            Call p攝怓僨乕僞乕_RW(gco僾儘僷Let, 2, CStr(Value))
        End Set
    End Property
    Friend Property p攝怓僨乕僞乕攚宨怓() As Integer
        Get
            Return CInt(p攝怓僨乕僞乕_RW(gco僾儘僷Get, 1))
        End Get
        Set(ByVal Value As Integer)
            Call p攝怓僨乕僞乕_RW(gco僾儘僷Let, 1, CStr(Value))
        End Set
    End Property
    Friend Property p攝怓僨乕僞乕(ByVal TypeID As Integer) As Integer
        Get
            Return CInt(p攝怓僨乕僞乕_RW(gco僾儘僷Get, TypeID))
        End Get
        Set(ByVal Value As Integer)
            Call p攝怓僨乕僞乕_RW(gco僾儘僷Let, TypeID, CStr(Value))
        End Set
    End Property
    Friend Function p攝怓僨乕僞乕傪慡偰愝掕(Optional ByRef r僂僀儞僪僂攚宨 As Integer = 0, Optional ByRef r尰嵼僇乕僪攚宨 As Integer = 0, Optional ByRef r暥帤怓1 As Integer = 0, Optional ByRef r暥帤怓2 As Integer = 0, Optional ByRef r暥帤怓3 As Integer = 0, Optional ByRef r暥帤怓4 As Integer = 0, Optional ByRef r暥帤怓5 As Integer = 0, Optional ByRef r摉傝僇乕僪 As Integer = 0, Optional ByRef r榞怓1 As Integer = 0, Optional ByRef r榞怓2 As Integer = 0, Optional ByRef r榞怓3 As Integer = 0, Optional ByRef r榞怓4 As Integer = 0) As String
        Return p攝怓僨乕僞乕_RW(222, 0, "", r僂僀儞僪僂攚宨, r尰嵼僇乕僪攚宨, r暥帤怓1, r暥帤怓2, r暥帤怓3, r暥帤怓4, r暥帤怓5, r摉傝僇乕僪, r榞怓1, r榞怓2, r榞怓3, r榞怓4)
    End Function
    Friend Function p攝怓僨乕僞乕傪慡偰偺幚懱偵愝掕(ByRef TypeID As Integer) As Boolean
        gggstr = p攝怓僨乕僞乕_RW(333, TypeID)
        Return True
    End Function
    Private Function p攝怓僨乕僞乕_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef TypeID As Integer = 0, Optional ByRef s As String = "", Optional ByRef r僂僀儞僪僂攚宨 As Integer = 0, Optional ByRef r尰嵼僇乕僪攚宨 As Integer = 0, Optional ByRef r暥帤怓1 As Integer = 0, Optional ByRef r暥帤怓2 As Integer = 0, Optional ByRef r暥帤怓3 As Integer = 0, Optional ByRef r暥帤怓4 As Integer = 0, Optional ByRef r暥帤怓5 As Integer = 0, Optional ByRef r摉傝僇乕僪 As Integer = 0, Optional ByRef r榞怓1 As Integer = 0, Optional ByRef r榞怓2 As Integer = 0, Optional ByRef r榞怓3 As Integer = 0, Optional ByRef r榞怓4 As Integer = 0) As String
        Const PropName As String = "p攝怓僨乕僞乕"
        Const cut As String = ","
        Const c僂僀儞僪僂攚宨 As Integer = 1, c尰嵼僇乕僪攚宨 As Integer = 2
        Const c暥帤怓1 As Integer = 3, c暥帤怓2 As Integer = 4, c暥帤怓3 As Integer = 5, c暥帤怓4 As Integer = 6, c暥帤怓5 As Integer = 7, c摉傝僇乕僪 As Integer = 8
        Const c榞怓1 As Integer = 9, c榞怓2 As Integer = 10, c榞怓3 As Integer = 11, c榞怓4 As Integer = 12
        Const cMinIDX As Integer = 1, cMaxIDX As Integer = 12, cBrsSTT As Integer = 8
        Static mmm(cMaxIDX) As Integer, Oldmmm(cMaxIDX) As Integer, DEFmmm(cMaxIDX) As Integer
        Static brs榞怓(cMaxIDX) As Integer '8, 9, 10, 11, 12 偺傒桳岠丅   0 - 7  偼僀儞僨僢僋僗傪堦抳偝偣傞偨傔偺僟儈乕偱丄忢偵侽偺僴儞僪儖偲側傞丅
        Dim c, a As Integer, sss() As String = {""}, www As String
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔  '2023/02/27  gco僾儘僷婯掕抣偼柍岠側屇傃弌偟偵側傞
                DEFmmm(c僂僀儞僪僂攚宨) = &H99FFBB : DEFmmm(c尰嵼僇乕僪攚宨) = &H881100 : DEFmmm(c暥帤怓1) = &HFF0000 : DEFmmm(c暥帤怓2) = &HFF : DEFmmm(c暥帤怓3) = &H8000 : DEFmmm(c暥帤怓4) = &H404040 : DEFmmm(c暥帤怓5) = &HC000C0
                DEFmmm(c摉傝僇乕僪) = System.Drawing.ColorTranslator.ToWin32(System.Drawing.Color.Red) : DEFmmm(c榞怓1) = &HC000 : DEFmmm(c榞怓2) = &HFF8080 : DEFmmm(c榞怓3) = &H80FF : DEFmmm(c榞怓4) = &HFF00FF
                '----------------------------------
                For a = cMinIDX To cMaxIDX : mmm(a) = DEFmmm(a) : Oldmmm(a) = -1 : brs榞怓(a) = 0 : Next
                '---------------------------------------------------------------
            Case 99 'on app end
                For a = cBrsSTT To cMaxIDX
                    If brs榞怓(a) <> 0 Then
                        Call DeleteObject(brs榞怓(a)) : brs榞怓(a) = 0
                    End If
                Next
                '---------------------------------------------------------------
            Case 222 'p攝怓僨乕僞乕傪慡偰愝掕
                mmm(c僂僀儞僪僂攚宨) = r僂僀儞僪僂攚宨 : mmm(c尰嵼僇乕僪攚宨) = r尰嵼僇乕僪攚宨 : mmm(c暥帤怓1) = r暥帤怓1 : mmm(c暥帤怓2) = r暥帤怓2 : mmm(c暥帤怓3) = r暥帤怓3 : mmm(c暥帤怓4) = r暥帤怓4 : mmm(c暥帤怓5) = r暥帤怓5
                mmm(c摉傝僇乕僪) = r摉傝僇乕僪 : mmm(c榞怓1) = r榞怓1 : mmm(c榞怓2) = r榞怓2 : mmm(c榞怓3) = r榞怓3 : mmm(c榞怓4) = r榞怓4
                '---------------------------------------------------------------
            Case 333 'p攝怓僨乕僞乕傪慡偰偺幚懱偵愝掕
                Call oo僂儘僂儘.aa攝怓僨乕僞乕傪慡偰偺幚懱偵愝掕(mmm, brs榞怓, TypeID)
                '---------------------------------------------------------------
            Case gco僾儘僷iniWR 'from 丂丂zz僾儘僷僥傿偺婯掕抣偲_INI_撉弌偟偲彂崬傒()      INI_彂崬傒
                www = ""
                For a = cMinIDX To cMaxIDX : www = www & CStr(mmm(a)) & cut : Next
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, www)
                '---------------------------------------------------------------
            Case gco僾儘僷iniRD 'from 丂丂zz僾儘僷僥傿偺婯掕抣偲_INI_撉弌偟偲彂崬傒()      INI_撉弌偟
                www = 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)
                If 12 = 嘳暥傪僇僢僩偟偰攝楍偵偡傞(www, cut, sss) Then
                    p攝怓僨乕僞乕(c僂僀儞僪僂攚宨) = Val(sss(1)) : p攝怓僨乕僞乕(c尰嵼僇乕僪攚宨) = Val(sss(2)) : p攝怓僨乕僞乕(c暥帤怓1) = Val(sss(3)) : p攝怓僨乕僞乕(c暥帤怓2) = Val(sss(4)) : p攝怓僨乕僞乕(c暥帤怓3) = Val(sss(5)) : p攝怓僨乕僞乕(c暥帤怓4) = Val(sss(6)) : p攝怓僨乕僞乕(c暥帤怓5) = Val(sss(7))
                    p攝怓僨乕僞乕(c摉傝僇乕僪) = Val(sss(8)) : p攝怓僨乕僞乕(c榞怓1) = Val(sss(9)) : p攝怓僨乕僞乕(c榞怓2) = Val(sss(10)) : p攝怓僨乕僞乕(c榞怓3) = Val(sss(11)) : p攝怓僨乕僞乕(c榞怓4) = Val(sss(12))
                End If
                '---------------------------------------------------------------
            Case gco僾儘僷Get
                a = 嘳悢抣斖埻Int(cMinIDX, cMaxIDX, TypeID)
                Return CStr(mmm(a))
                '---------------------------------------------------------------
            Case gco僾儘僷Let
                a = 嘳悢抣斖埻Int(cMinIDX, cMaxIDX, TypeID)
                c = 嘳怓偺抣偺専嵏廋惓抣(Val(s))
                If mmm(a) = c Then Return CStr(c)
                mmm(a) = c
                '2017/12/13  偙偺娭悢撪偱偼懠偺僆僽僕僃僋僩偵丄怓偺抣傗丄僽儔僔僴儞僪儖偼丄愝掕偟側偄丅
                '懠偺僆僽僕僃僋僩偼丄偦傟帺恎偺愝掕偺偨傔偵娭悢傪屇傃弌偡偙偲丅
                '---------------------------------------------------------------
            Case 336998  'aa怓偲僼僅儞僩偺愝掕Dlg_Load_1_Disposed_2(1, Me) ---> 怓偲僼僅儞僩偺愝掕Dlg.怓愝掕僟僀傾儘僌Show0(......)
                gggbol = 怓偲僼僅儞僩偺愝掕Dlg.怓愝掕僟僀傾儘僌Show0(pp僎乕儉幚峴拞, gmDlg怓偲僼僅儞僩偺愝掕Dlg, "僂僀儞僪僂偲丄僇乕僪偺怓偲丄僼僅儞僩傪丄愝掕", DEFmmm, mmm, p僼僅儞僩柤DEF, p僼僅儞僩柤, p僼僅儞僩懢帤DEF, p僼僅儞僩懢帤)
                '---------------------------------------------------------------
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, 222, gco僾儘僷Let   '2023/02/27  gco僾儘僷婯掕抣偼柍岠側屇傃弌偟偵側傞 gco僾儘僷婯掕抣
                For a = cMinIDX To cMaxIDX
                    If Oldmmm(a) <> mmm(a) Then
                        Oldmmm(a) = mmm(a)
                        If a >= cBrsSTT Then
                            If brs榞怓(a) <> 0 Then
                                Call DeleteObject(brs榞怓(a)) : brs榞怓(a) = 0
                            End If
                            brs榞怓(a) = CreateSolidBrush(mmm(a))
                        End If
                    End If
                Next
        End Select
        Return "0"
        'qqqqq "p攝怓僨乕僞乕_RW()"
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p僼僅儞僩柤p僼僅儞僩懢帤摨帪愝掕(ByRef 僼僅儞僩柤 As String, ByRef 僼僅儞僩懢帤 As Boolean) As Boolean
        m僼僅儞僩柤僼僅儞僩懢帤摨帪愝掕 = True
        p僼僅儞僩懢帤 = 僼僅儞僩懢帤
        p僼僅儞僩柤 = 僼僅儞僩柤
        m僼僅儞僩柤僼僅儞僩懢帤摨帪愝掕 = False
        Return True
    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, CStr(Value))
            If Not oo僂儘僂儘 Is Nothing Then oo僂儘僂儘.aa僼僅儞僩GDI嶌惉偲攋婞(4)
        End Set
    End Property
    Friend ReadOnly Property p僼僅儞僩柤DEF() As String
        Get
            Return p僼僅儞僩柤_RW(gco僾儘僷婯掕抣)
        End Get
    End Property
    Private Function p僼僅儞僩柤_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        Const PropName As String = "p僼僅儞僩柤"
        Static 抣, Def抣 As String
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔
                抣 = pct暥帤夋憸梡.Font.Name : Def抣 = 抣
            Case gco僾儘僷婯掕抣
                Return Def抣
            Case gco僾儘僷Get
                Return 抣
            Case gco僾儘僷Let
                抣 = s
            Case gco僾儘僷iniWR
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD
                抣 = 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s)
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD
                If m僼僅儞僩柤僼僅儞僩懢帤摨帪愝掕 Then Return 抣
                If 僾儘僷僐儅儞僪 = gco僾儘僷Let Then Call gm傾僾儕屌桳僋儔僗.aa嵞嶌惉儌乕僪偺愝掕(2)
        End Select
        Return 抣
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend ReadOnly Property p僼僅儞僩懢帤DEF() As Boolean
        Get
            Return CBool(p僼僅儞僩懢帤_RW(gco僾儘僷婯掕抣))
        End Get
    End Property
    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))
            If Not oo僂儘僂儘 Is Nothing Then oo僂儘僂儘.aa僼僅儞僩GDI嶌惉偲攋婞(4)
        End Set
    End Property
    Private Function p僼僅儞僩懢帤_RW(ByRef 僾儘僷僐儅儞僪 As Integer, Optional ByRef s As String = "") As String
        Const PropName As String = "p僼僅儞僩懢帤"
        Static 抣, Def抣 As Boolean
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷柤 : Return PropName
            Case gco僾儘僷弶婜壔
                抣 = True : Def抣 = 抣
            Case gco僾儘僷婯掕抣
                Return CStr(Def抣)
            Case gco僾儘僷Get
                Return CStr(抣)
            Case gco僾儘僷Let
                抣 = CBool(s)
            Case gco僾儘僷iniWR
                Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD
                抣 = CBool(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s))
        End Select
        Select Case 僾儘僷僐儅儞僪
            Case gco僾儘僷弶婜壔, gco僾儘僷Let, gco僾儘僷iniRD
                If m僼僅儞僩柤僼僅儞僩懢帤摨帪愝掕 Then Return CStr(抣)
                If 僾儘僷僐儅儞僪 = gco僾儘僷Let Then Call gm傾僾儕屌桳僋儔僗.aa嵞嶌惉儌乕僪偺愝掕(2)
        End Select
        Return CStr(抣)
    End Function
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    '仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
    Friend Function p尰嵼偺僇乕僪儃僢僋僗偺埵抲傪愝掕() As Integer
        Dim RET As Integer = CInt(p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW(121212))
        RET = p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕傪撉崬()
        Return RET
    End Function
    Friend Function p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕傪撉崬() As Integer
        If Me.WindowState = FormWindowState.Minimized Then Return 0
        Return CInt(p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW(998877))
    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))
            Call p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕_RW(121212)
        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 : Dim old抣 As Integer : Const 抣DEF As Integer = 50005000  'CenterX = 0.5000   'CenterY = 0.5000
        Const 墢庢傝 As Integer = 10 : Dim 暆, 崅, cx, cy, xxx, yyy As Integer
        old抣 = 抣
        Select Case 僾儘僷僐儅儞僪
            Case 121212 'Set Post By Current 抣
                If Me.WindowState = FormWindowState.Minimized Then Return ""
                暆 = Me.ClientRectangle.Width
                崅 = Me.ClientRectangle.Height
                cx = CInt(CSng((抣 \ 10000) / 10000) * 暆)
                cy = CInt(CSng((抣 Mod 10000) / 10000) * 崅)
                With pct尰嵼偺僇乕僪
                    xxx = cx - (.Width * 0.5)
                    xxx = Math.Max(xxx, 墢庢傝)
                    xxx = Math.Min(xxx, 暆 - 墢庢傝 - .Width)
                    yyy = cy - (.Height * 0.5)
                    yyy = Math.Max(yyy, 墢庢傝 + mMenuHight)
                    yyy = Math.Min(yyy, 崅 - 墢庢傝 - .Height)
                    pct尰嵼偺僇乕僪.SetBounds(xxx, yyy, 0, 0, BoundsSpecified.Location)
                End With
                gggint = p尰嵼偺僇乕僪儃僢僋僗偺埵抲僨乕僞乕傪撉崬()

            Case 998877 'Set Data from pct尰嵼偺僇乕僪
                If Me.WindowState = FormWindowState.Minimized Then Return ""
                暆 = Me.ClientRectangle.Width
                崅 = Me.ClientRectangle.Height
                With pct尰嵼偺僇乕僪
                    If Not 嘳巕cont偼恊cont偺椞堟撪偵偁傞(Me, pct尰嵼偺僇乕僪, 墢庢傝) Then
                        xxx = Math.Max(.Left, 墢庢傝)
                        xxx = Math.Min(xxx, 暆 - 墢庢傝 - .Width)
                        yyy = Math.Max(.Top, 墢庢傝 + mMenuHight)
                        yyy = Math.Min(yyy, 崅 - 墢庢傝 - .Height)
                    Else
                        xxx = .Left
                        yyy = .Top
                    End If
                End With
                With pct尰嵼偺僇乕僪
                    Dim xx As Integer = 10000 * (CInt(((xxx + .Width * 0.5) / 暆) * 10000))
                    Dim yy As Integer = 10000 * (yyy + .Height * 0.5) / 崅
                    抣 = xx + yy
                End With
                '------------------------------------------------------------------------
            Case gco僾儘僷柤
                Return PropName
            Case gco僾儘僷弶婜壔
                抣 = 抣DEF
            Case gco僾儘僷婯掕抣
                Return CStr(抣DEF)
            Case gco僾儘僷Get
                Return CStr(抣)
            Case gco僾儘僷Let
                抣 = CInt(s)
            Case gco僾儘僷iniWR : Return 嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniWR, PropName, CStr(抣))
            Case gco僾儘僷iniRD : 抣 = CInt(嘳Ini僨乕僞乕暥_RW(gco僾儘僷iniRD, PropName, s))
        End Select
        Return 抣
    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, &H55FFFF&, &HFF0020&, &H55AA&}
        Const 壓 As Integer = 1 : Const 忋 As Integer = 3 : Static 抣(忋) As Integer
        Dim typ As Integer = 嘳悢抣斖埻Int(壓, 忋, 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 gAppEventMaker"

    Private Sub 僀儀儞僩gAppEventMaker_僎乕儉奐巒偲掆巭(ByVal r奐巒True掆巭False As Boolean, ByRef wOptionRetStr As String) Handles 僀儀儞僩gAppEventMaker.僎乕儉奐巒偲掆巭
        mn1gam僎乕儉傪奐巒.Visible = Not r奐巒True掆巭False
        mn1gam僎乕儉僗僩僢僾.Visible = r奐巒True掆巭False
        mn3opt傾僀僐儞儌乕僪偺傾僀僐儞愝掕.Visible = Not r奐巒True掆巭False
        mn9help.Visible = Not r奐巒True掆巭False
        mnaaa扵偡僇乕僪傪曄峏.Visible = r奐巒True掆巭False
        mnuvvv偍傑偐偣.Visible = r奐巒True掆巭False
        mnuwww僆乕僩儌乕僪奐巒.Visible = r奐巒True掆巭False
        If Not r奐巒True掆巭False Then gggbol = zz僆乕僩儌乕僪Op(4)
    End Sub

    Private Sub 僀儀儞僩gAppEventMaker_MakeEvent僎乕儉攚宨夋憸偺昞帵ONOFF(ByVal r夋憸昞帵OnOff As Boolean) Handles 僀儀儞僩gAppEventMaker.僎乕儉攚宨夋憸偺昞帵ONOFF
        If gm傾僾儕廔椆偡傞 Then Return
        Dim bol As Boolean = gm傾僾儕屌桳僋儔僗.p僎乕儉攚宨夋憸傪昞帵BOOL 'Dim bol As Boolean = (mn5僎乕儉攚宨夋憸傪昞帵偡傞.Checked)
        Dim NotDlg As Boolean = Not (gAppEventMaker.僼僅乕儉偺昞帵徚嫀_愝掕偲庢摼(0, gmDlgFile僎乕儉梡))
        mn5攚宨夋憸偺僼傽僀儖傪愝掕.Enabled = bol And NotDlg
        mn5僎乕儉攚宨夋憸偺愗傝懼偊帪娫娫妘.Enabled = bol And NotDlg
        mn5僎乕儉攚宨夋憸傪師偺夋憸偵愗傝懼偊.Enabled = bol And NotDlg

    End Sub

#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(rOwner)
                    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 = 屲clsUrouroPoipoi.c僇乕僪宆Allmax   'cUser7宍  '16     
        w傾僾儕宆_max = 屲clsUrouroPoipoi.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僇乕僪傪巊梡偟偰偄傞 = oo僂儘僂儘.p僎乕儉僇乕僪宆_巊梡拞偱偡(r僇乕僪宆IDX)
        Dim Rgn榞 As Integer = 0
        wIsOK = 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 = oo僂儘僂儘.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 mn1game偙偺傾僾儕傪廔椆_Click(Nothing, Nothing)
            Case Else
                If Not pp僎乕儉幚峴拞 Then
                    Call mn1gam僎乕儉傪奐巒_Click(Nothing, Nothing)
                Else
                    'ok
                End If
                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 use
    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 "仭仭巐frmDlgPctFilesList丂傪丂巊梡偡傞偨傔偺丂僟儈乕僐乕僪"
    Friend Sub mn8僗僀僗僀偲儐儔儐儔傪幚峴_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
    Friend Sub mn8僗僀僗僀偲儐儔儐儔偡傋偰掆巭_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
    Friend Sub mn8僗僀僗僀幚峴_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
    Friend Sub mn8僗僀僗僀掆巭_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
    Friend Sub mn8儐儔儐儔幚峴_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
    Friend Sub mn8儐儔儐儔掆巭_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
    Friend Sub mn8僗僀僗僀梡僇乕僪宆傪愝掕_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub
#End Region

End Class




