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

📄 frmcolors.frm

📁 采用一个自定义类来操作数据库
💻 FRM
📖 第 1 页 / 共 3 页
字号:
End If

'Show the color dialog box...
Dialog.Flags = cdlCCFullOpen Or cdlCCRGBInit
Dialog.ShowColor
If Err > 0 Then Exit Sub

'Set the color to the control currently selected...
If lblControlSelected.Caption = lblLabelColor.Caption Then
    lblLabelColor.ForeColor = Dialog.Color
ElseIf lblControlSelected.Caption = lblButtonLabelColor.Caption Then
    lblButtonLabelColor.ForeColor = Dialog.Color
ElseIf lblControlSelected.Caption = txtTextBoxBackGroundColor.Text Then
    txtTextBoxBackGroundColor.BackColor = Dialog.Color
    txtTextBoxForeGroundColor.BackColor = Dialog.Color
ElseIf lblControlSelected.Caption = txtTextBoxForeGroundColor.Text Then
    txtTextBoxForeGroundColor.ForeColor = Dialog.Color
    txtTextBoxBackGroundColor.ForeColor = Dialog.Color
End If

'Set the dirty flag to true...
iDirty = True

End Sub
Private Sub lblWindowsColors_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 lblApply_Click()

Call SaveChanges

End Sub
Private Sub lblApply_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 lblApply_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 lblHideSolidColors_Click()

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

End Sub

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

Help.HelpText = "Click here to see the default colors in Windows."

End Sub
Private Sub lblWindowsColors_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 lstListBoxBackGroundColor_Click()

Help.HelpText = "Click here to change the list box background colors."

End Sub
Private Sub lstListBoxBackGroundColor_GotFocus()

'Display the control selected...
lblControlSelected.Caption = lstListBoxBackGroundColor.Text

'Set the red lights picture...
imgLights(0).Picture = imgRedLight(0).Picture
imgLights(1).Picture = imgRedLight(0).Picture
imgLights(2).Picture = imgRedLight(0).Picture
imgLights(3).Picture = imgRedLight(0).Picture
imgLights(4).Picture = imgRedLight(1).Picture

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

On Local Error Resume Next

'Change the label color...
If Button = vbLeftButton Then
    If lblControlSelected.Caption = lblLabelColor.Caption Then
        lblLabelColor.ForeColor = picColorPalette.Point(x, Y)
    ElseIf lblControlSelected.Caption = lblButtonLabelColor.Caption Then
        lblButtonLabelColor.ForeColor = picColorPalette.Point(x, Y)
    ElseIf lblControlSelected.Caption = txtTextBoxBackGroundColor.Text Then
        txtTextBoxBackGroundColor.BackColor = picColorPalette.Point(x, Y)
        txtTextBoxForeGroundColor.BackColor = picColorPalette.Point(x, Y)
    ElseIf lblControlSelected.Caption = txtTextBoxForeGroundColor.Text Then
        txtTextBoxForeGroundColor.ForeColor = picColorPalette.Point(x, Y)
        txtTextBoxBackGroundColor.ForeColor = picColorPalette.Point(x, Y)
        lstListBoxBackGroundColor.ForeColor = picColorPalette.Point(x, Y)
    ElseIf lblControlSelected.Caption = lstListBoxBackGroundColor.Text Then
        lstListBoxBackGroundColor.BackColor = picColorPalette.Point(x, Y)
    End If
    iDirty = True
End If

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

Help.HelpText = "Click on any color here to change the color for the selected item."

End Sub
Private Sub imgExit_Click()

lblExit_Click

End Sub

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

If Button = vbLeftButton Then
    imgExit.Picture = imgOKPicture(1).Picture
    lblExit.ForeColor = QBColor(0)
End If

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

imgExit.Picture = imgOKPicture(0).Picture
lblExit.ForeColor = lButtonForeColor

End Sub
Private Sub imgSave_Click()

lblSave_Click

End Sub

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

If Button = vbLeftButton Then
    imgSave.Picture = imgOKPicture(1).Picture
    lblSave.ForeColor = QBColor(0)
End If

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

imgSave.Picture = imgOKPicture(0).Picture
lblSave.ForeColor = lButtonForeColor

End Sub
Private Sub lblButtonLabelColor_Click()

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

'Set the red lights picture...
imgLights(0).Picture = imgRedLight(0).Picture
imgLights(1).Picture = imgRedLight(1).Picture
imgLights(2).Picture = imgRedLight(0).Picture
imgLights(3).Picture = imgRedLight(0).Picture
imgLights(4).Picture = imgRedLight(0).Picture

End Sub
Private Sub lblCategories_MouseMove(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 lblExit_Click()

'Unload the help window...
If Help.HelpCallingForm = Me.Name Then
    Unload frmHelper
End If

Unload Me

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

If Button = vbLeftButton Then
    imgExit.Picture = imgOKPicture(1).Picture
    lblExit.ForeColor = QBColor(0)
End If

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

imgExit.Picture = imgOKPicture(0).Picture
lblExit.ForeColor = lButtonForeColor

End Sub
Private Sub lblLabelColor_Click()

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

'Set the red lights picture...
imgLights(0).Picture = imgRedLight(1).Picture
imgLights(1).Picture = imgRedLight(0).Picture
imgLights(2).Picture = imgRedLight(0).Picture
imgLights(3).Picture = imgRedLight(0).Picture
imgLights(4).Picture = imgRedLight(0).Picture

End Sub
Private Sub lblSave_Click()

Call SaveChanges

'Unload the help window...
If Help.HelpCallingForm = Me.Name Then
    Unload frmHelper
End If

Unload Me

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

If Button = vbLeftButton Then
    imgSave.Picture = imgOKPicture(1).Picture
    lblSave.ForeColor = QBColor(0)
End If

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

imgSave.Picture = imgOKPicture(0).Picture
lblSave.ForeColor = lButtonForeColor

End Sub

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

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

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

On Local Error Resume Next

'Change the label color...
If Button = vbLeftButton Then
    If lblControlSelected.Caption = lblLabelColor.Caption Then
        lblLabelColor.ForeColor = picColorsSquare.Point(x, Y)
    ElseIf lblControlSelected.Caption = lblButtonLabelColor.Caption Then
        lblButtonLabelColor.ForeColor = picColorsSquare.Point(x, Y)
    ElseIf lblControlSelected.Caption = txtTextBoxBackGroundColor.Text Then
        txtTextBoxBackGroundColor.BackColor = picColorsSquare.Point(x, Y)
        txtTextBoxForeGroundColor.BackColor = picColorsSquare.Point(x, Y)
    ElseIf lblControlSelected.Caption = txtTextBoxForeGroundColor.Text Then
        txtTextBoxForeGroundColor.ForeColor = picColorsSquare.Point(x, Y)
        txtTextBoxBackGroundColor.ForeColor = picColorsSquare.Point(x, Y)
        lstListBoxBackGroundColor.ForeColor = picColorsSquare.Point(x, Y)
    ElseIf lblControlSelected.Caption = lstListBoxBackGroundColor.Text Then
        lstListBoxBackGroundColor.BackColor = picColorsSquare.Point(x, Y)
    End If
    iDirty = True
End If

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

Help.HelpText = "Click on any color here to change the color for the selected item."

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

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

End Sub
Private Sub picOptionsPanel_MouseMove(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 Timer1_Timer()

On Local Error Resume Next

'Save...
If imgSave.Enabled = False And iDirty = True Then
    imgSave.Enabled = True
    lblSave.Enabled = True
ElseIf imgSave.Enabled = True And iDirty = False Then
    imgSave.Enabled = False
    lblSave.Enabled = False
End If

'Apply...
If imgApply.Enabled = False And iDirty = True Then
    imgApply.Enabled = True
    lblApply.Enabled = True
ElseIf imgApply.Enabled = True And iDirty = False Then
    imgApply.Enabled = False
    lblApply.Enabled = False
End If

End Sub
Private Sub txtTextBoxBackGroundColor_Click()

'Display the control selected...
lblControlSelected.Caption = txtTextBoxBackGroundColor.Text

'Set the red lights picture...
imgLights(0).Picture = imgRedLight(0).Picture
imgLights(1).Picture = imgRedLight(0).Picture
imgLights(2).Picture = imgRedLight(1).Picture
imgLights(3).Picture = imgRedLight(0).Picture
imgLights(4).Picture = imgRedLight(0).Picture

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

Help.HelpText = "Click here to change the text box background 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 txtTextBoxForeGroundColor_Click()

'Display the control selected...
lblControlSelected.Caption = txtTextBoxForeGroundColor.Text

'Set the red lights picture...
imgLights(0).Picture = imgRedLight(0).Picture
imgLights(1).Picture = imgRedLight(0).Picture
imgLights(2).Picture = imgRedLight(0).Picture
imgLights(3).Picture = imgRedLight(1).Picture
imgLights(4).Picture = imgRedLight(0).Picture

End Sub

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

Help.HelpText = "Click here to change the text box foreground 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

⌨️ 快捷键说明

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