home *** CD-ROM | disk | FTP | other *** search
- Global ADay As Integer
- Global Theyear As Integer
- Global TheMonth As Integer
- Global ThisMonth As Integer
- Global Months(1 To 12) As String
- Global TheDay As Integer
- Global StartDay As Integer
- Global dow As Integer
- Global WeekDays(1 To 7) As String
- Global Jan As Integer
- Global Feb As Integer
- Global Mar As Integer
- Global Apr As Integer
- Global May As Integer
- Global Jun As Integer
- Global Jul As Integer
- Global Aug As Integer
- Global Sep As Integer
- Global Octr As Integer
- Global Nov As Integer
- Global Dec As Integer
-
- Global Const Black = &H0&
- Global Const Red = &HFF&
- Global Const Green = &HFF00&
- Global Const YELLOW = &HFFFF&
- Global Const Blue = &HFF0000
- Global Const MAGENTA = &HFF00FF
- Global Const CYAN = &HFFFF00
- Global Const WHITE = &HFFFFFF
- Global Const Gray = &HC0C0C0
-
- Sub FillMonth ()
- dow = Weekday(DateSerial(Theyear, TheMonth, 1))
- ADay = Day(Now)
- Startblock = dow - 1
- Select Case TheMonth
- Case 1
- DaysInMonth = Jan
- Case 2
- DaysInMonth = Feb
- Case 3
- DaysInMonth = Mar
- Case 4
- DaysInMonth = Apr
- Case 5
- DaysInMonth = May
- Case 6
- DaysInMonth = Jun
- Case 7
- DaysInMonth = Jul
- Case 8
- DaysInMonth = Aug
- Case 9
- DaysInMonth = Sep
- Case 10
- DaysInMonth = Octr
- Case 11
- DaysInMonth = Nov
- Case 12
- DaysInMonth = Dec
- End Select
-
- ' Reset the calendar buttons
-
- For i = 0 To 36
- 'Calendar.DayButton(i).Caption = ""
- Calendar.DayButton(i).Visible = False
- Calendar.DayButton(i).Font3D = 0
- Calendar.DayButton(i).ForeColor = Black
- Next i
-
-
- For i = Startblock To ((DaysInMonth) + (Startblock - 1))
- Calendar.DayButton(i).Visible = True
- Calendar.DayButton(i).Caption = (i - (Startblock - 1))
- Next i
-
- Calendar.MonthBox.Caption = Months(TheMonth) + Str$(Theyear)
-
-
- If TheMonth = Month(Now) Then
- Calendar.DayButton(Day(Now) + Startblock - 1).ForeColor = Blue
-
- End If
-
- Calendar.DayButton(0).ForeColor = Red
- Calendar.DayButton(7).ForeColor = Red
- Calendar.DayButton(14).ForeColor = Red
- Calendar.DayButton(21).ForeColor = Red
- Calendar.DayButton(28).ForeColor = Red
- Calendar.DayButton(35).ForeColor = Red
-
-
- End Sub
-
-