home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form w_date_demo
- BorderStyle = 3 'Fixed Dialog
- Caption = "ctDate (Standard Calendar Control) Demo"
- ClientHeight = 6315
- ClientLeft = 1215
- ClientTop = 2010
- ClientWidth = 8925
- Height = 6720
- Icon = "ct_date.frx":0000
- Left = 1155
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MDIChild = -1 'True
- MinButton = 0 'False
- ScaleHeight = 6315
- ScaleWidth = 8925
- ShowInTaskbar = 0 'False
- Top = 1665
- Width = 9045
- Begin VB.TextBox txt_date
- Height = 345
- Left = 6000
- TabIndex = 21
- Top = 1380
- Width = 2115
- End
- Begin VB.CommandButton Command2
- Caption = "E&xit"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 465
- Left = 4140
- TabIndex = 14
- Top = 5670
- Width = 1215
- End
- Begin VB.Frame Frame2
- Caption = "Focus Type"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 1725
- Left = 4020
- TabIndex = 9
- Top = 3600
- Width = 1455
- Begin VB.OptionButton Option8
- Caption = "Lowered"
- Height = 285
- Left = 180
- TabIndex = 13
- Top = 1350
- Width = 975
- End
- Begin VB.OptionButton Option7
- Caption = "Raised"
- Height = 285
- Left = 180
- TabIndex = 12
- Top = 990
- Width = 1155
- End
- Begin VB.OptionButton Option6
- Caption = "Fill"
- Height = 285
- Left = 180
- TabIndex = 11
- Top = 630
- Width = 1035
- End
- Begin VB.OptionButton Option5
- Caption = "Regular"
- Height = 285
- Left = 180
- TabIndex = 10
- Top = 270
- Value = -1 'True
- Width = 975
- End
- End
- Begin VB.Frame Frame1
- Caption = "Date Border"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 1725
- Left = 4020
- TabIndex = 4
- Top = 1530
- Width = 1455
- Begin VB.OptionButton Option4
- Caption = "Lowered"
- Height = 255
- Left = 180
- TabIndex = 8
- Top = 1350
- Value = -1 'True
- Width = 1095
- End
- Begin VB.OptionButton Option3
- Caption = "Raised"
- Height = 255
- Left = 180
- TabIndex = 7
- Top = 990
- Width = 975
- End
- Begin VB.OptionButton Option2
- Caption = "None"
- Height = 255
- Left = 180
- TabIndex = 6
- Top = 630
- Width = 975
- End
- Begin VB.OptionButton Option1
- Caption = "Regular"
- Height = 255
- Left = 180
- TabIndex = 5
- Top = 270
- Width = 975
- End
- End
- Begin VB.CommandButton Command1
- Caption = "Today"
- Height = 375
- Left = 1380
- TabIndex = 3
- Top = 5580
- Width = 915
- End
- Begin PushLib.ctPush ctPush1
- Height = 360
- Left = 8100
- TabIndex = 22
- Top = 1380
- Width = 315
- _version = 65536
- _extentx = 555
- _extenty = 635
- _stockprops = 70
- caption = "ctPush"
- picture = "ct_date.frx":030A
- picposition = 1
- winstyle = 0
- bevelsize = 1
- buttonheight = 29
- buttonwidth = 41
- picbevel = 3
- roundcorners = 0 'False
- focusborder = 0 'False
- piconly = -1 'True
- End
- Begin VB.Label lbl_button
- Alignment = 2 'Center
- Caption = "Click on the arrows beside the title to move to a different month."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 9.75
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 735
- Left = 6120
- TabIndex = 19
- Top = 5130
- Visible = 0 'False
- Width = 2235
- End
- Begin DateLib.ctDate ctDate2
- Height = 2985
- Left = 6000
- TabIndex = 18
- Top = 1740
- Visible = 0 'False
- Width = 2415
- _version = 65536
- _extentx = 4260
- _extenty = 5265
- _stockprops = 100
- borderstyle = 1
- bordercolor = 8421504
- focuscolor = 12648447
- titlecolor = 16777215
- levelcolor = 8421376
- date = 35065
- day = 3
- year = 1996
- action = 0
- leveloffset = 0
- datexsize = 1
- dateysize = 3
- leveldepth = 2
- dateborder = 1
- focustype = 3
- monthbuttons = -1 'True
- End
- Begin VB.Label sle_Date
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 345
- Left = 780
- TabIndex = 17
- Top = 1170
- Width = 2715
- End
- Begin VB.Label Label2
- Caption = "Date :"
- Height = 285
- Left = 240
- TabIndex = 16
- Top = 1170
- Width = 555
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = $"ct_date.frx":0554
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H00800000&
- Height = 645
- Left = 300
- TabIndex = 15
- Top = 180
- Width = 8415
- End
- Begin DataLib.ctData ctData2
- Height = 375
- Left = 2280
- TabIndex = 2
- Top = 5580
- Width = 1185
- _version = 65536
- _extentx = 2090
- _extenty = 661
- _stockprops = 64
- style = 1
- arrowsize = 0
- bevelsize = 1
- End
- Begin DataLib.ctData ctData1
- Height = 375
- Left = 240
- TabIndex = 1
- Top = 5580
- Width = 1140
- _version = 65536
- _extentx = 2011
- _extenty = 661
- _stockprops = 64
- arrowsize = 0
- bevelsize = 1
- End
- Begin DateLib.ctDate ctDate1
- Height = 3735
- Left = 240
- TabIndex = 0
- Top = 1620
- Width = 3255
- _version = 65536
- _extentx = 5741
- _extenty = 6588
- _stockprops = 100
- borderstyle = 1
- bordercolor = 8421504
- weekendcolor = 16776960
- titlecolor = 8388608
- date = 35065
- day = 3
- year = 1996
- action = 0
- leveloffset = 0
- datexsize = 0
- dateysize = 0
- dateborder = 3
- End
- Begin VB.Label Label4
- Alignment = 2 'Center
- Caption = $"ct_date.frx":0670
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 9.75
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 2085
- Left = 6060
- TabIndex = 20
- Top = 2070
- Width = 2295
- End
- Attribute VB_Name = "w_date_demo"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- ctDate1.Today
- End Sub
- Private Sub Command2_Click()
- Unload w_date_demo
- End Sub
- Private Sub ctData1_ClickCenter()
- ctDate1.LastMonth
- End Sub
- Private Sub ctData1_ClickLeft()
- ctDate1.LastYear
- End Sub
- Private Sub ctData1_ClickRight()
- ctDate1.LastDay
- End Sub
- Private Sub ctData2_ClickCenter()
- ctDate1.NextMonth
- End Sub
- Private Sub ctData2_ClickLeft()
- ctDate1.NextDay
- End Sub
- Private Sub ctData2_ClickRight()
- ctDate1.NextYear
- End Sub
- Private Sub ctDate1_DateChange(nDOW As Integer, nDay As Integer, nMonth As Integer, nYear As Integer)
- Dim MonthName As String
- Dim nCntr As Integer
- If (nMonth = 1) Then
- ctDate1.DayColor(1) = RGB(0, 255, 0)
- ElseIf (nMonth = 2) Then
- ctDate1.DayColor(14) = RGB(0, 255, 255)
- ElseIf (nMonth = 4) Then
- ctDate1.DayColor(14) = RGB(0, 255, 0)
- ElseIf (nMonth = 5) Then
- ctDate1.DayColor(22) = RGB(0, 255, 0)
- ElseIf (nMonth = 7) Then
- ctDate1.DayColor(1) = RGB(0, 255, 0)
- ctDate1.DayColor(4) = RGB(0, 255, 0)
- ElseIf (nMonth = 9) Then
- ctDate1.DayColor(9) = RGB(0, 255, 0)
- ElseIf (nMonth = 10) Then
- For nCntr = 1 To 31
- ctDate1.DayColor(nCntr) = RGB(128 + (nCntr * 4), 128 + (nCntr * 4), 0)
- Next
- ElseIf (nMonth = 11) Then
- ctDate1.DayColor(11) = RGB(0, 255, 0)
- ElseIf (nMonth = 12) Then
- ctDate1.DayColor(24) = RGB(255, 255, 0)
- ctDate1.DayColor(25) = RGB(0, 255, 0)
- ctDate1.DayColor(26) = RGB(255, 255, 0)
- End If
- If (nMonth = 1) Then
- MonthName = "Jan."
- ElseIf (nMonth = 2) Then
- MonthName = "Feb."
- ElseIf (nMonth = 3) Then
- MonthName = "Mar."
- ElseIf (nMonth = 4) Then
- MonthName = "Apr."
- ElseIf (nMonth = 5) Then
- MonthName = "May"
- ElseIf (nMonth = 6) Then
- MonthName = "June"
- ElseIf (nMonth = 7) Then
- MonthName = "July"
- ElseIf (nMonth = 8) Then
- MonthName = "Aug."
- ElseIf (nMonth = 9) Then
- MonthName = "Sep."
- ElseIf (nMonth = 10) Then
- MonthName = "Oct."
- ElseIf (nMonth = 11) Then
- MonthName = "Nov."
- ElseIf (nMonth = 12) Then
- MonthName = "Dec."
- MonthName = "???"
- End If
- MonthName = MonthName + " " + Str$(nDay) + " / " + Str$(nYear)
- If (nDOW = 1) Then
- sle_date.Caption = "Sunday " + MonthName
- ElseIf (nDOW = 2) Then
- sle_date.Caption = "Monday " + MonthName
- ElseIf (nDOW = 3) Then
- sle_date.Caption = "Tuesday " + MonthName
- ElseIf (nDOW = 4) Then
- sle_date.Caption = "Wednesday " + MonthName
- ElseIf (nDOW = 5) Then
- sle_date.Caption = "Thursday " + MonthName
- ElseIf (nDOW = 6) Then
- sle_date.Caption = "Friday " + MonthName
- ElseIf (nDOW = 7) Then
- sle_date.Caption = "Saturday " + MonthName
- End If
- End Sub
- Private Sub ctDate2_DateChange(nDOW As Integer, nDay As Integer, nMonth As Integer, nYear As Integer)
- Dim MonthName As String
- If (nMonth = 1) Then
- MonthName = "January"
- ElseIf (nMonth = 2) Then
- MonthName = "February"
- ElseIf (nMonth = 3) Then
- MonthName = "March"
- ElseIf (nMonth = 4) Then
- MonthName = "April"
- ElseIf (nMonth = 5) Then
- MonthName = "May"
- ElseIf (nMonth = 6) Then
- MonthName = "June"
- ElseIf (nMonth = 7) Then
- MonthName = "July"
- ElseIf (nMonth = 8) Then
- MonthName = "August"
- ElseIf (nMonth = 9) Then
- MonthName = "September"
- ElseIf (nMonth = 10) Then
- MonthName = "October"
- ElseIf (nMonth = 11) Then
- MonthName = "November"
- ElseIf (nMonth = 12) Then
- MonthName = "December"
- Else
- MonthName = "???"
- End If
- MonthName = MonthName + " " + Str$(nDay) + " / " + Str$(nYear)
- txt_date.Text = MonthName
- End Sub
- Private Sub ctDate2_LostFocus()
- ctDate2.Visible = False
- lbl_button.Visible = False
- End Sub
- Private Sub ctPush1_Click()
- ctDate2.Visible = True
- lbl_button.Visible = True
- End Sub
- Private Sub Form_Load()
- ' Center the window on the screen
- Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.15
- 'w_mdi_main.bt_date = BUTTON_DISABLE
- ctDate1.Today
- ctDate2.Today
- End Sub
- Private Sub Option1_Click()
- ctDate1.DateBorder = 0
- End Sub
- Private Sub Option2_Click()
- ctDate1.DateBorder = 1
- End Sub
- Private Sub Option3_Click()
- ctDate1.DateBorder = 2
- End Sub
- Private Sub Option4_Click()
- ctDate1.DateBorder = 3
- End Sub
- Private Sub Option5_Click()
- ctDate1.FocusType = 0
- End Sub
- Private Sub Option6_Click()
- ctDate1.FocusType = 1
- End Sub
- Private Sub Option7_Click()
- ctDate1.FocusType = 2
- End Sub
- Private Sub Option8_Click()
- ctDate1.FocusType = 3
- End Sub
-