Option Strict Off
Option Explicit On
'------------------------------------ 2024/03/23 ------------------------------------
Public Class frmDlgUserBtnOneSet
#Region "愰尵"
    Private mLoading As Boolean = True
    Event aaeDlgWnd_ShowTrue_HideFalse(ByRef ShowTrue_HideFalse As Boolean)
    Event aae僀儀儞僩_FormClosed_偺嵟屻偵屇傃弌偟偰偄傑偡()
#End Region

#Region "Form 僀儀儞僩"
    Friend Function aa儐乕僓乕僥僉僗僩傪愝掕_Show0(ByVal rOwner As Form, ByVal rTextMaxLen As Integer, ByVal rUserKeyUB As Color, ByVal rUserKeyUF As Color) As Boolean
        Try
            Me.UserTextBox.MaxLength = rTextMaxLen
            Me.Icon = rOwner.Icon
            Me.SetBounds(rOwner.Left + 5, (rOwner.Top + rOwner.Bottom) \ 2 - (Me.Height \ 2), 0, 0, BoundsSpecified.Location)
            Me.Show(rOwner)
            Call rad儃僞儞偐傜撉傒崬傒_Click_Do()
            RaiseEvent aaeDlgWnd_ShowTrue_HideFalse(True)
            Return True
        Catch ex As Exception
            Call 嘳MsgBox_OK_忣曬("aa儐乕僓乕僥僉僗僩傪愝掕_Show1()" & gggCR2 & ex.ToString)
            Return False
        End Try
    End Function

    Private Sub frmDlgUserBtnOneSet_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        gggint = zzAppIniFileOp(0)      'INI 僼傽僀儖偑懚嵼偟側偄応崌偵丄壗傕偟側偄僐乕僪丅
        mLoading = False
        Call frmDlgUserBtnOneSet_ResizeEnd(Nothing, Nothing)
    End Sub
    Private Sub frmDlgUserBtnOneSet_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd
        If mLoading Then Return
        Dim n As Integer = UserTextBox.Left
        Dim w As Integer = Me.ClientRectangle.Width - n - n
        Dim h As Integer = Me.ClientRectangle.Height - UserTextBox.Top - n
        UserTextBox.SetBounds(0, 0, w, h, BoundsSpecified.Size)
        UserTextBox.Width = w
    End Sub
    Private Sub frmDlgUserBtnOneSet_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        gggint = zzAppIniFileOp(1)  '昁偢屇傃弌偟傑偡丅
        RaiseEvent aaeDlgWnd_ShowTrue_HideFalse(False)
    End Sub
    Private Sub frmDlgUserBtnOneSet_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        RaiseEvent aae僀儀儞僩_FormClosed_偺嵟屻偵屇傃弌偟偰偄傑偡()
    End Sub
    Private Sub frmDlgUserBtnOneSet_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
        qqqqq("frmDlgUserBtnOneSet_Disposed")
    End Sub
    '仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴仴
    '僼僅乕儉僒僀僘偲埵抲偩偗偱偼側偔丄偄傠傫側僨乕僞乕曐懚偡傞応崌偺張棟
    '奺僼僅乕儉偵婰擖偡傞丅
    Private Function zzAppIniFileOp(ByVal Load_0_QueryUnload_1_Resize_2_DoIniSave_3 As Long) As Boolean
        '撉弌偟帪偵丂INI 僼傽僀儖偑懚嵼偟側偄応崌偼丂False丂傪曉偟傑偡丅
        If gggAppIniFile Is Nothing Then Return False
        Try
            Dim RETVAL As Boolean = False
            Dim Open0_Save1 As Long
            Open0_Save1 = Load_0_QueryUnload_1_Resize_2_DoIniSave_3
            With gggAppIniFile
                Select Case Open0_Save1
                    Case 0, 1
                        RETVAL = gggAppIniFile.OpenSaveMain(Open0_Save1, Me.Name & "屌桳偺幆暿暥", Me, 屲clsAppINI.cAppIniFormPostSize)
                        '******************************************************************************************************
                        Dim s1 As String = "", s2 As String = "", s3 As String = ""
                        With UserTextBox.Font
                            If Open0_Save1 = 0 Then
                                gggint = gggAppIniFile.OpenSaveString(Open0_Save1, Me.Name & "-FontData", Me, s1, s2, s3)   '屄暿偺暥帤楍偺僨乕僞乕傪巊梡
                                Try
                                    If s1 <> "" And s2 <> "" And s3 <> "" Then
                                        If 嘳僐儞僩儘乕儖僼僅儞僩曄峏_NameSizeBold(UserTextBox, s1, CSng(s2), CBool(s3)) Then
                                        End If
                                    End If
                                Catch ex As Exception
                                End Try
                            Else
                                s1 = .Name : s2 = CStr(.Size) : s3 = CStr(.Bold)
                                gggint = gggAppIniFile.OpenSaveString(Open0_Save1, Me.Name & "-FontData", Me, s1, s2, s3)   '屄暿偺暥帤楍偺僨乕僞乕傪巊梡
                            End If
                        End With
                        '******************************************************************************************************
                    Case 2
                        '偦傟偧傟偺僼僅乕儉偱丄埵抲偲僒僀僘偺僨乕僞乕傪曐懚偟傑偡丅
                        RETVAL = gggAppIniFile.FormSizeDataSetOnReSize(Me)
                End Select
            End With
            Return RETVAL
        Catch
            MsgBox(ErrorToString)
        End Try
        Return False
    End Function
    '仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯仯
#End Region

#Region "僐儞僩儘乕儖 僀儀儞僩"
    Private Sub rad儃僞儞偐傜撉傒崬傒_Click_Do()
        If rad儃僞儞偐傜撉傒崬傒.Checked Then
            UserTextBox.BackColor = Color.White : lblCurMode愢柧.ForeColor = Color.Black : lblCurMode愢柧.Text = "儐乕僓乕儃僞儞偺僙儖傪僋儕僢僋偡傞偲丄儃僞儞偺弌椡暥帤傪撉傒崬傒傑偡丅"
        Else
            UserTextBox.BackColor = Color.Yellow : lblCurMode愢柧.ForeColor = Color.Red : lblCurMode愢柧.Text = "儐乕僓乕儃僞儞偺僙儖傪僋儕僢僋偡傞偲丄仠儃僞儞偵弌椡暥帤傪愝掕偟傑偡丅"
        End If
    End Sub
    Private Sub rad儃僞儞偐傜撉傒崬傒_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rad儃僞儞偐傜撉傒崬傒.Click, rad儃僞儞偵彂偒崬傒.Click
        Call rad儃僞儞偐傜撉傒崬傒_Click_Do()
    End Sub
    Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub
    Private Sub btnFontSize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFontSize.Click
        With FontDialog1
            .ShowEffects = False
            .Font = UserTextBox.Font
            .MaxSize = 24
            .MinSize = 9
            .AllowVerticalFonts = False
            If FontDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
                UserTextBox.Font = FontDialog1.Font
                UserTextBox.Font = FontDialog1.Font
            End If
        End With
    End Sub
#End Region

#Region "奜晹僀儞僞乕僼僃僀僗"
    Friend Function aaTextCurrent() As String
        Return Trim(UserTextBox.Text)
    End Function
    Friend Function aaCurCellIndex(ByVal Get0_Set1 As Integer, ByVal CurCellIndex As Integer) As Integer
        Static idx As Integer
        If Get0_Set1 = 0 Then
            If idx = 0 Then idx = 2 '弶婜壔
            Return idx
        Else
            idx = CurCellIndex
        End If
        Return idx
    End Function
#End Region

End Class