⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmcolors.frm

📁 采用一个自定义类来操作数据库
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      Caption         =   "Cancel"
      ForeColor       =   &H00C0FFC0&
      Height          =   195
      Left            =   5160
      TabIndex        =   0
      Tag             =   "ButtonLabel"
      Top             =   3870
      Width           =   495
   End
   Begin VB.Image imgExit 
      Height          =   375
      Left            =   4920
      Picture         =   "frmColors.frx":96B75
      Stretch         =   -1  'True
      Top             =   3780
      Width           =   945
   End
   Begin VB.Image imgSave 
      Enabled         =   0   'False
      Height          =   375
      Left            =   3990
      Picture         =   "frmColors.frx":98597
      Stretch         =   -1  'True
      Top             =   3780
      Width           =   945
   End
   Begin VB.Image imgApply 
      Enabled         =   0   'False
      Height          =   375
      Left            =   5850
      Picture         =   "frmColors.frx":99FB9
      Stretch         =   -1  'True
      Top             =   3780
      Width           =   945
   End
   Begin VB.Image imgWindowsColors 
      Height          =   375
      Left            =   2430
      Picture         =   "frmColors.frx":9B9DB
      Stretch         =   -1  'True
      Top             =   3780
      Width           =   1575
   End
   Begin VB.Image imgOptionsPanel 
      Height          =   300
      Index           =   1
      Left            =   3540
      Picture         =   "frmColors.frx":9D3FD
      Stretch         =   -1  'True
      Top             =   630
      Width           =   3150
   End
   Begin VB.Image imgHelp 
      Height          =   375
      Left            =   5850
      Picture         =   "frmColors.frx":A4EBF
      Stretch         =   -1  'True
      Top             =   3420
      Width           =   945
   End
End
Attribute VB_Name = "frmColors"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim iDirty As Boolean
Sub SaveChanges()

On Local Error Resume Next

'Save the color settings to the ini file...
Call WriteINI("Colors", "lLabelForeColor", lblLabelColor.ForeColor)
Call WriteINI("Colors", "lButtonForeColor", lblButtonLabelColor.ForeColor)
Call WriteINI("Colors", "lTextBoxBackColor", txtTextBoxBackGroundColor.BackColor)
Call WriteINI("Colors", "lTextBoxForeColor", txtTextBoxForeGroundColor.ForeColor)
Call WriteINI("Colors", "lListBoxBackColor", lstListBoxBackGroundColor.BackColor)

iDirty = False
QuickRef.UpdateColors = True
lblExit.Caption = "Close"

End Sub

Private Sub btnColors_Click()
    lblSave_Click
End Sub

Private Sub chkAutoApply_Click()

'Auto Apply...
If chkAutoApply.Value = 1 Then
    lblApply_Click
End If

End Sub
Private Sub chkShowHideSolidColors_Click()

picColorsSquare.Visible = chkShowHideSolidColors.Value = 1

End Sub
Private Sub Form_Load()

'Load the main menu's form settings...
Call LoadINISettings

'Set program colors...
Call SetColors(Me)

'Form Coordinates...
Me.Width = QuickRef.MediumMenuWidth
Me.Height = QuickRef.MediumMenuHeight

'Display the control selected...
lblControlSelected.Caption = lblLabelColor.Caption

iDirty = False

End Sub
Sub LoadINISettings()

'Form Coordinates...
Me.Left = val(ReadINI(Me.Name, "Left"))
Me.Top = val(ReadINI(Me.Name, "Top"))

'Auto Apply...
chkAutoApply = val(ReadINI(Me.Name, "AutoApply"))

End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = ""

'Move the form if the user is pressing and holding the mouse button...
If Button = vbLeftButton Then
    Call DragForm(Me)
End If

End Sub
Private Sub Form_Unload(Cancel As Integer)

Dim x As Long

'Prompt to save first...
If iDirty Then
    x = MsgBox("Save changes before exiting?", vbYesNoCancel + vbQuestion, "Save Changes...")
    Select Case x
        Case vbYes
            Call SaveChanges
        Case vbCancel
            Cancel = True
            Exit Sub
    End Select
End If

'Save INI Settings...
Call SaveINISettings

End Sub
Sub SaveINISettings()

'Form coordinates...
Call WriteINI(Me.Name, "Left", Me.Left)
Call WriteINI(Me.Name, "Top", Me.Top)

'Auto Apply...
Call WriteINI(Me.Name, "AutoApply", chkAutoApply.Value)

End Sub
Private Sub Image1_Click()

'Display the control selected...
lblControlSelected.Caption = lblButtonLabelColor.Caption

End Sub

Private Sub imgApply_Click()

Call SaveChanges

End Sub

Private Sub imgApply_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

If Button = vbLeftButton Then
    imgApply.Picture = imgOKPicture(1).Picture
    lblApply.ForeColor = QBColor(0)
End If

End Sub
Private Sub imgApply_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)

imgApply.Picture = imgOKPicture(0).Picture
lblApply.ForeColor = lButtonForeColor

End Sub

Private Sub imgHelp_Click()

lblHelp_Click

End Sub

Private Sub imgHelp_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

If Button = vbLeftButton Then
    imgHelp.Picture = imgOKPicture(1).Picture
    lblHelp.ForeColor = QBColor(0)
End If

End Sub

Private Sub imgHelp_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)

imgHelp.Picture = imgOKPicture(0).Picture
lblHelp.ForeColor = lButtonForeColor

End Sub
Private Sub imgLights_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)

On Local Error Resume Next

'Change colors...
If Button = vbLeftButton Then
    Select Case Index
        Case 0
            lblLabelColor_Click
        Case 1
            lblButtonLabelColor_Click
        Case 2
            txtTextBoxBackGroundColor_Click
        Case 3
            txtTextBoxForeGroundColor_Click
        Case 4
            lstListBoxBackGroundColor_GotFocus
    End Select
End If

End Sub

Private Sub imgOptionsPanel_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)

'Move the form if the user is pressing and holding the mouse button...
If Button = vbLeftButton Then
    Call DragForm(Me)
End If

End Sub
Private Sub imgWindowsColors_Click()

lblWindowsColors_Click

End Sub
Private Sub imgWindowsColors_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

If Button = vbLeftButton Then
    imgWindowsColors.Picture = imgOKPicture(1).Picture
    lblWindowsColors.ForeColor = QBColor(0)
End If

End Sub

Private Sub imgWindowsColors_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)

imgWindowsColors.Picture = imgOKPicture(0).Picture
lblWindowsColors.ForeColor = lButtonForeColor

End Sub

Private Sub lblApply_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Click here to apply your new color settings."

End Sub
Private Sub lblAutoApply_Click()

'Show / Hide Solid Colors...
If chkAutoApply.Value = 1 Then
    chkAutoApply.Value = 0
Else
    chkAutoApply.Value = 1
End If

End Sub

Private Sub lblAutoApply_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Check this box to automatically apply the color changes to all open windows immediately."

End Sub
Private Sub lblButtonLabelColor_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Click here to change the button colors."

'Move the form if the user is pressing and holding the mouse button...
If Button = vbLeftButton Then
    Call DragForm(Me)
End If

End Sub

Private Sub lblExit_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Click here to cancel any color settings you have made."

End Sub
Private Sub lblHelp_Click()

Help.HelpCallingForm = Me.Name

frmHelper.Show
frmHelper.ZOrder

End Sub

Private Sub lblHelp_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

If Button = vbLeftButton Then
    imgHelp.Picture = imgOKPicture(1).Picture
    lblHelp.ForeColor = QBColor(0)
End If

End Sub

Private Sub lblHelp_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Shows the Help Window."

End Sub
Private Sub lblHelp_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)

imgHelp.Picture = imgOKPicture(0).Picture
lblHelp.ForeColor = lButtonForeColor

End Sub

Private Sub lblHideSolidColors_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Click here to show and hide the square colors."

End Sub
Private Sub lblLabelColor_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Click here to change the label colors."

'Move the form if the user is pressing and holding the mouse button...
If Button = vbLeftButton Then
    Call DragForm(Me)
End If

End Sub

Private Sub lblSave_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)

Help.HelpText = "Click here to apply the new color settings."

End Sub
Private Sub lblWindowsColors_Click()

On Local Error Resume Next

'Set the dialog boxes color to the color of the control that is selected...
If lblControlSelected.Caption = lblLabelColor.Caption Then
    Dialog.Color = lblLabelColor.ForeColor
ElseIf lblControlSelected.Caption = lblButtonLabelColor.Caption Then
    Dialog.Color = lblButtonLabelColor.ForeColor
ElseIf lblControlSelected.Caption = txtTextBoxBackGroundColor.Text Then
    Dialog.Color = txtTextBoxBackGroundColor.BackColor
ElseIf lblControlSelected.Caption = txtTextBoxForeGroundColor.Text Then
    Dialog.Color = txtTextBoxForeGroundColor.ForeColor

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -