Private Declare Function CreateEllipticRgn Lib "gdi32.dll" (ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32.dll" (lpPoint As Any, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
Private Declare Function FillRgn Lib "gdi32.dll" (ByVal hdc As Long, ByVal hRgn As Long, ByVal hBrush As Long) As Long
Private Declare Function FrameRgn Lib "gdi32.dll" (ByVal hdc As Long, ByVal hRgn As Long, ByVal hBrush As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function OffsetRgn Lib "gdi32.dll" (ByVal hRgn As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" (ByVal hWd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function GetPixel Lib "gdi32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetPixelV Lib "gdi32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
Private m_DrawHourOutline As Boolean
Private m_DrawMinuteOutline As Boolean
Private m_DrawShadow As Boolean
Private m_DrawBodyOutline As Boolean
Private m_DrawSecond As Boolean
Private m_ShowMinorPoint As Boolean
Private m_ShowMajorPoint As Boolean
Private m_MinuteOutline As OLE_COLOR
Private m_HourOutline As OLE_COLOR
Private m_MajorPoint As OLE_COLOR
Private m_MinorPoint As OLE_COLOR
Private m_SecondPointer As OLE_COLOR
Private m_MinutePointer As OLE_COLOR
Private m_HourPointer As OLE_COLOR
Private m_CircleBorder As OLE_COLOR
Private m_ClockBody As OLE_COLOR
Private m_AntiAliasing As Boolean
Private m_button As Integer
Private CenterX As Long
Private CenterY As Long
Public Event Click()
Public Event DblClick()
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseMove
Private Function Dec2Rad(ByVal dblDec As Double) As Double 'Convert Decimal To Radian, I don't know math that well, so I got it from some where
Dim dRad As Double
dRad = Pi / 180
Dec2Rad = dblDec * dRad
End Function
Private Sub ShowTime()
Dim dH As Long, dH1 As Long, dH2 As Long, iH As Integer 'Hour Variables
Dim dM As Long, dM1 As Long, dM2 As Long, iM As Integer 'Minute Variables
Dim dS As Long 'Second Variable
Dim dHX As Double, dHX1 As Double, dHX2 As Double 'Hour Variables
Dim dHY As Double, dHY1 As Double, dHY2 As Double
Dim dMX As Double, dMX1 As Double, dMX2 As Double 'Minute Variables
Dim dMY As Double, dMY1 As Double, dMY2 As Double
Dim dSX As Double, dSY As Double 'Second Variables
Dim pP(1 To 4) As POINTAPI 'The Polygons Points
Dim hRgn As Long, hBrush As Long 'Fill Color
Dim fW As Long, fH As Long
Dim iCircle As Integer, r As Integer, g As Integer, B As Integer
fW = UserControl.ScaleWidth
fH = UserControl.ScaleHeight
iH = Hour(Time) '| Get the Current Hour
If iH > 12 Then iH = iH - 12 '| Make it 12 Hour Format