Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, lpPoint As POINTAPI) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Private HiLite&
Private HiLite2&
Private LoLite&
Private Greyed&
Private Shadow&
Private mEnabled As Boolean
Private cw&, ch&, X2&
Private mCurrentState As Boolean
Private mShadowLine As Boolean
Private mBackStyle As Integer
Private mCaption As String
Private xONOFF&
Private wONOFF&
Public Event Click()
Public Event DblClick()
Public Property Get Caption() As String
Caption = mCaption
End Property
Public Property Let Caption(ByVal vNewValue As String)
mCaption = vNewValue
PropertyChanged Caption
DrawControl
End Property
Public Property Let Value(bVal As Boolean)
mCurrentState = bVal
PropertyChanged Value
DrawControl
End Property
Public Property Get Value() As Boolean
Value = mCurrentState
End Property
Public Property Let BackStyle(bVal As Integer)
If bVal < 1 Or bVal > 2 Or bVal = mBackStyle Then Exit Property
mBackStyle = bVal
PropertyChanged BackStyle
DrawControl
End Property
Public Property Get BackStyle() As Integer
BackStyle = mBackStyle
End Property
Public Property Let ShadowLine(bVal As Boolean)
mShadowLine = bVal
PropertyChanged ShadowLine
DrawControl
End Property
Public Property Get ShadowLine() As Boolean
ShadowLine = mShadowLine
End Property
Private Sub SplitRGB(ByVal clr&, r&, G&, B&)
r = clr And &HFF: G = (clr \ &H100&) And &HFF: B = (clr \ &H10000) And &HFF
End Sub
Private Sub Gradient(dc&, X&, Y&, dx&, dy&, ByVal c1&, ByVal c2&, v As Boolean)