📄 styler~1.ctl
字号:
DefineRect 0, ScaleHeight / 2 - 1, 2, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(170, 217, 246), RGB(170, 228, 252)
DefineRect ScaleWidth - 3, 0, ScaleWidth, ScaleHeight / 2 - 1
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(254, 254, 254), RGB(196, 231, 250)
DefineRect ScaleWidth - 3, ScaleHeight / 2 - 1, ScaleWidth, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(170, 217, 246), RGB(170, 228, 252)
DefineRect 0, ScaleHeight - 3, ScaleWidth / 2, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(181, 232, 253), RGB(231, 255, 251)
DefineRect ScaleWidth / 2, ScaleHeight - 3, ScaleWidth, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(231, 255, 251), RGB(181, 232, 253)
DefineRect 0, 1, ScaleWidth / 2, 2
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(181, 232, 253), RGB(231, 255, 251)
DefineRect ScaleWidth / 2, 1, ScaleWidth, 2
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(231, 255, 251), RGB(181, 232, 253)
UserControl.ForeColor = RGB(32, 87, 170)
RoundRect UserControl.hDC, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
GoTo Vista1Done
End If
If bolHasFocus = True And bolMouseDown = False Then
DrawGradientFourColour UserControl.hDC, 1, 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(168, 198, 223), RGB(227, 244, 248), RGB(152, 189, 217), RGB(236, 253, 254)
DrawGradientFourColour UserControl.hDC, 1, ScaleHeight / 2 - 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(126, 173, 207), RGB(234, 254, 254), RGB(161, 195, 222), RGB(237, 255, 255)
DrawGradientFourColour UserControl.hDC, ScaleWidth / 2, 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(227, 244, 248), RGB(168, 198, 223), RGB(236, 253, 254), RGB(152, 189, 217)
DrawGradientFourColour UserControl.hDC, ScaleWidth / 2, ScaleHeight / 2 - 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(234, 254, 254), RGB(126, 173, 207), RGB(237, 255, 255), RGB(161, 195, 222)
DefineRect 0, 0, 2, ScaleHeight / 2 - 1
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(254, 254, 254), RGB(195, 217, 234)
DefineRect 0, ScaleHeight / 2 - 1, 2, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(169, 201, 227), RGB(168, 206, 227)
DefineRect ScaleWidth - 3, 0, ScaleWidth, ScaleHeight / 2 - 1
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(254, 254, 254), RGB(195, 217, 234)
DefineRect ScaleWidth - 3, ScaleHeight / 2 - 1, ScaleWidth, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(169, 201, 227), RGB(168, 206, 227)
DefineRect 0, ScaleHeight - 3, ScaleWidth / 2, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(180, 213, 230), RGB(249, 252, 253)
DefineRect ScaleWidth / 2, ScaleHeight - 3, ScaleWidth, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(249, 252, 253), RGB(180, 213, 230)
DefineRect 0, 1, ScaleWidth / 2, 2
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(180, 213, 230), RGB(249, 252, 253)
DefineRect ScaleWidth / 2, 1, ScaleWidth, 2
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(249, 252, 253), RGB(180, 213, 230)
UserControl.ForeColor = RGB(32, 87, 170)
RoundRect UserControl.hDC, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
If bolFocusDottedRect = True Then
'Draw dotted focus rect.
DrawDottedFocusRect
End If
GoTo Vista1Done
End If
If bolMouseDown = True Then
DrawGradientFourColour UserControl.hDC, 1, 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(142, 179, 209), RGB(218, 239, 248), RGB(120, 165, 200), RGB(224, 245, 253)
DrawGradientFourColour UserControl.hDC, 1, ScaleHeight / 2 - 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(85, 142, 186), RGB(217, 244, 253), RGB(129, 170, 205), RGB(225, 246, 254)
DrawGradientFourColour UserControl.hDC, ScaleWidth / 2, 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(218, 239, 248), RGB(142, 179, 209), RGB(224, 245, 253), RGB(120, 165, 200)
DrawGradientFourColour UserControl.hDC, ScaleWidth / 2, ScaleHeight / 2 - 1, ScaleWidth / 2, ScaleHeight / 2 - 1, RGB(217, 244, 253), RGB(85, 142, 186), RGB(225, 246, 254), RGB(129, 170, 205)
DefineRect 0, 0, 2, ScaleHeight / 2 - 1
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(245, 248, 251), RGB(179, 205, 226)
DefineRect 0, ScaleHeight / 2 - 1, 2, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(138, 181, 212), RGB(143, 188, 213)
DefineRect ScaleWidth - 3, 0, ScaleWidth, ScaleHeight / 2 - 1
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(245, 248, 251), RGB(179, 205, 226)
DefineRect ScaleWidth - 3, ScaleHeight / 2 - 1, ScaleWidth, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Top to Bottom], RGB(138, 181, 212), RGB(143, 188, 213)
DefineRect 0, ScaleHeight - 3, ScaleWidth / 2, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(158, 197, 219), RGB(249, 252, 253)
DefineRect ScaleWidth / 2, ScaleHeight - 3, ScaleWidth, ScaleHeight
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(249, 252, 253), RGB(158, 197, 219)
DefineRect 0, 1, ScaleWidth / 2, 2
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(158, 197, 219), RGB(249, 252, 253)
DefineRect ScaleWidth / 2, 1, ScaleWidth, 2
DrawGradientTwoColour UserControl.hDC, [Left to Right], RGB(249, 252, 253), RGB(158, 197, 219)
UserControl.ForeColor = RGB(32, 87, 170)
RoundRect UserControl.hDC, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
If bolHasFocus = True And bolFocusDottedRect = True Then
DrawDottedFocusRect
End If
GoTo Vista1Done
End If
Vista1Done:
DrawIcon
UserControl.ForeColor = oleForeColor
PrintText strCaption, udtCaptionAlign
Exit Sub
End If
If bolMouseOver = True And bolFocusDottedRect = True Then DrawDottedFocusRect
End Sub
Public Property Get CaptionAlignment() As CaptionAlignmentS
Attribute CaptionAlignment.VB_Description = "Button Caption Alignment."
CaptionAlignment = udtCaptionAlign
End Property
Public Property Let CaptionAlignment(ByVal NewValue As CaptionAlignmentS)
COX = 0
COY = 0
udtCaptionAlign = NewValue
PropertyChanged "CaptionAlignment"
PaintControl
End Property
Public Property Get IconAlignment() As PICTURE_ALIGN
Attribute IconAlignment.VB_Description = "Button Icon Alignment."
IconAlignment = udtIconAlign
End Property
Public Property Let IconAlignment(ByVal NewValue As PICTURE_ALIGN)
udtIconAlign = NewValue
PropertyChanged "IconAlignment"
PaintControl
End Property
Public Property Get Caption() As String
Attribute Caption.VB_Description = "Button Caption."
Caption = strCaption
End Property
Public Property Let Caption(ByVal NewValue As String)
strCaption = NewValue
PropertyChanged "Caption"
PaintControl
End Property
Public Property Get ForeColor() As OLE_COLOR
Attribute ForeColor.VB_Description = "Button Caption ForeColour."
ForeColor = oleForeColor
End Property
Public Property Let ForeColor(ByVal NewValue As OLE_COLOR)
oleForeColor = NewValue
PropertyChanged "ForeColor"
PaintControl
End Property
Public Property Get CaptionDisableColor() As OLE_COLOR
Attribute CaptionDisableColor.VB_Description = "Button Disabled Caption colour."
CaptionDisableColor = CapDis
End Property
Public Property Let CaptionDisableColor(ByVal NewValue As OLE_COLOR)
CapDis = NewValue
PropertyChanged "CaptionDisableColor"
PaintControl
End Property
Public Property Get CaptionEffectColor() As OLE_COLOR
Attribute CaptionEffectColor.VB_Description = "If You Apply Caption Effect(Shadow,Engraved,etc).This Colour used in Effect."
CaptionEffectColor = CEC
End Property
Public Property Let CaptionEffectColor(ByVal NewValue As OLE_COLOR)
CEC = NewValue
PropertyChanged "CaptionEffectColor"
PaintControl
End Property
Public Property Get CaptionEffect() As CaptionTextEffects
Attribute CaptionEffect.VB_Description = "Caption Text Effects (Shadow,Engraved,Outline,Embossed.etc)."
CaptionEffect = CTE
End Property
Public Property Let CaptionEffect(ByVal NewValue As CaptionTextEffects)
CTE = NewValue
PropertyChanged "CaptionEffect"
PaintControl
End Property
Public Property Get CaptionOffsetX() As Integer
Attribute CaptionOffsetX.VB_Description = "Caption Offset X."
CaptionOffsetX = COX
End Property
Public Property Let CaptionOffsetX(ByVal NewValue As Integer)
COX = NewValue
PropertyChanged "CaptionOffsetX"
PaintControl
End Property
Public Property Get CaptionOffsetY() As Integer
Attribute CaptionOffsetY.VB_Description = "Caption Offset Y."
CaptionOffsetY = COY
End Property
Public Property Let CaptionOffsetY(ByVal NewValue As Integer)
COY = NewValue
PropertyChanged "CaptionOffsetY"
PaintControl
End Property
Public Property Get ShadowOffsetX() As Integer
Attribute ShadowOffsetX.VB_Description = "If You apply Shadow in Captioneffects.Shadow Offset X."
ShadowOffsetX = SOX
End Property
Public Property Let ShadowOffsetX(ByVal NewValue As Integer)
SOX = NewValue
PropertyChanged "ShadowOffsetX"
PaintControl
End Property
Public Property Get ShadowOffsetY() As Integer
Attribute ShadowOffsetY.VB_Description = "If You apply Shadow in Captioneffects.Shadow Offset Y."
ShadowOffsetY = SOY
End Property
Public Property Let ShadowOffsetY(ByVal NewValue As Integer)
SOY = NewValue
PropertyChanged "ShadowOffsetY"
PaintControl
End Property
Public Property Get IconDisableColor() As OLE_COLOR
Attribute IconDisableColor.VB_Description = "Button Disabled Icon colour."
IconDisableColor = IcoDis
End Property
Public Property Let IconDisableColor(ByVal NewValue As OLE_COLOR)
IcoDis = NewValue
PropertyChanged "IconDisableColor"
PaintControl
End Property
Public Property Get Theme() As COLOR_STYLE
Attribute Theme.VB_Description = "Button Themes Styles."
Theme = udtColorStyle
End Property
Public Property Let Theme(ByVal NewValue As COLOR_STYLE)
If Me.Enabled = False Then
If NewValue = [Media Player 11] Then
CapDis = RGB(183, 182, 186)
IcoDis = RGB(183, 182, 186)
ElseIf NewValue = [Office 2007 1] Then
CapDis = RGB(154, 182, 200)
IcoDis = RGB(161, 189, 207)
ElseIf NewValue = [Vista 1] Then
CapDis = RGB(183, 182, 186)
IcoDis = RGB(178, 178, 178)
End If
End If
udtColorStyle = NewValue
PropertyChanged "Theme"
PaintControl
End Property
Public Property Get FocusDottedRect() As Boolean
Attribute FocusDottedRect.VB_Description = "Create Button Focus Dotted Rect."
FocusDottedRect = bolFocusDottedRect
End Property
Public Property Let FocusDottedRect(ByVal NewValue As Boolean)
bolFocusDottedRect = NewValue
PropertyChanged "FocusDottedRect"
PaintControl
End Property
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "Button Enabled/Disable."
Enabled = bolEnabled
End Property
Public Property Let Enabled(ByVal NewValue As Boolean)
bolEnabled = NewValue
PropertyChanged "Enabled"
PaintControl
End Property
Public Property Get Font() As Font
Attribute Font.VB_Description = "Button Caption Font."
Set Font = fntFont
End Property
Public Property Set Font(ByVal NewValue As Font)
Set fntFont = NewValue
Set UserControl.Font = NewValue
PropertyChanged "Font"
PaintControl
End Property
Public Property Get IconTransparentColour() As OLE_COLOR
Attribute IconTransparentColour.VB_Description = "Button Icon MASK/TRANSPARENT Colour."
IconTransparentColour = IcoTransparent
End Property
Public Property Let IconTransparentColour(ByVal NewValue As OLE_COLOR)
IcoTransparent = NewValue
PropertyChanged "IconTransparentColour"
PaintControl
End Property
Public Property Get Icon() As Picture
Attribute Icon.VB_Description = "Button Icon."
Set Icon = picIcon
End Property
Public Property Set Icon(ByVal NewValue As Picture)
Set picIcon = NewValue
Set imgIcon.Picture = NewValue
imgIcon.AutoSize = True
PropertyChanged "Icon"
PaintControl
End Property
Public Property Get RoundedValue() As Long
Attribute RoundedValue.VB_Description = "Button Border Rounded Value."
RoundedValue = lonRoundValue
End Property
Public Property Let RoundedValue(ByVal NewValue As Long)
lonRoundValue = NewValue
PropertyChanged "RoundedValue"
PaintControl
End Property
Private Sub tmrCheck_Timer()
If bolEnabled = False Then Exit Sub
Dim lonPosRet As Long, lonCurHWND As Long
tmrCheck.Enabled = False
lonPosRet = GetCursorPos(udtPoint)
lonCurHWND = WindowFromPoint(udtPoint.X, udtPoint.Y)
If bolMouseOver = False Then
If lonCurHWND = UserControl.hWnd Then
bolMouseOver = True
PaintControl
RaiseEvent MouseEnters(udtPoint.X, udtPoint.Y)
End If
Else
If lonCurHWND <> UserControl.hWnd Then
bolMouseOver = False
PaintControl
RaiseEvent MouseLeaves(udtPoint.X, udtPoint.Y)
End If
End If
tmrCheck.Enabled = True
End Sub
Private Sub UserControl_AccessKeyPress(KeyAscii As Integer)
MsgBox KeyAscii
End Sub
Private Sub UserControl_Click()
If bolEnabled = True Then RaiseEvent Click
End Sub
Private Sub UserControl_DblClick()
If bolEnabled = True Then RaiseEvent DoubleClick
End Sub
Private Sub UserControl_GotFocus()
If bolEnabled = True Then
bolHasFocus = True
PaintControl
End If
End Sub
Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer)
If bolEnabled = True Then
RaiseEvent KeyDown(KeyCode, Shift)
If KeyCode = 32 Then
bolMouseDown = True
PaintControl
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -