-
Notifications
You must be signed in to change notification settings - Fork 0
/
DatePickerDayLabel.cls
74 lines (58 loc) · 1.63 KB
/
DatePickerDayLabel.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "DatePickerDayLabel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private formObj As FormDatePicker
Private WithEvents labelObj As MSForms.Label
Attribute labelObj.VB_VarHelpID = -1
Private labelDate As Variant
Private Sub Class_Initialize()
Set formObj = Nothing
Set labelObj = Nothing
labelDate = Null
End Sub
Private Sub labelObj_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim selectedDate As Variant
Call formObj.resetHover
If IsNull(labelDate) Then
Exit Sub
End If
formObj.setHoverLabel Me
End Sub
Private Sub labelObj_click()
Dim obj As MSForms.Label
Dim ldate As Date
Dim monthInt As Integer
Dim yearInt As Integer
If IsNull(labelDate) Then
Exit Sub
End If
monthInt = Month(labelDate)
yearInt = Year(labelDate)
formObj.setSelectedLabel Me
formObj.setDisableRefresh True
formObj.CmbMonth.listIndex = monthInt - 1
formObj.SpinYear.value = yearInt
formObj.setDisableRefresh False
Call formObj.refresh
End Sub
Public Sub setLabelObj(obj As MSForms.Label)
Set labelObj = obj
End Sub
Public Function getLabelObj() As MSForms.Label
Set getLabelObj = labelObj
End Function
Public Sub setFormObj(obj As UserForm)
Set formObj = obj
End Sub
Public Sub setLabelDate(dateVar As Variant)
labelDate = dateVar
End Sub
Public Function getLabelDate() As Variant
getLabelDate = labelDate
End Function