home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{415A09B4-D805-11D0-B7C8-444553540000}#1.1#0"; "CSCALBTN.OCX"
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Computer Simple Calendar Sample"
- ClientHeight = 3525
- ClientLeft = 4185
- ClientTop = 3315
- ClientWidth = 6375
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3525
- ScaleWidth = 6375
- StartUpPosition = 1 'CenterOwner
- Begin VB.CommandButton Command2
- Caption = "Save"
- Height = 375
- Left = 3900
- TabIndex = 2
- Top = 2940
- Width = 975
- End
- Begin VB.CommandButton Command1
- Caption = "Close"
- Height = 375
- Left = 5160
- TabIndex = 3
- Top = 2940
- Width = 975
- End
- Begin VB.TextBox txtEvent
- Alignment = 2 'Center
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Enabled = 0 'False
- Height = 2235
- Left = 3840
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 0
- TabStop = 0 'False
- Top = 600
- Width = 2355
- End
- Begin CalendarBtn.CSCalendar CSCalendar1
- Height = 3195
- Left = 240
- TabIndex = 1
- Top = 180
- Width = 3495
- _ExtentX = 6165
- _ExtentY = 5636
- ShowSelectMenu = 0 'False
- Caption = "Computer Simple"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty DaysFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty ButtonFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty CellFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- WeekendTransparent= 0 'False
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "Today's Events"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 315
- Left = 3840
- TabIndex = 4
- Top = 180
- Width = 2295
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileSave
- Caption = "Save"
- End
- Begin VB.Menu mnuFileExit
- Caption = "Exit"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- End
- End Sub
- Private Sub Command2_Click()
- SaveData IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "sample.dat"
- End Sub
- Private Sub CSCalendar1_DateSelected(ByVal New_Date As Variant)
- On Error Resume Next
- ' Add/Edit a primary event
- CSCalendar1.ShowInputDialog New_Date, CSPrimaryEvent
- txtEvent.Text = CSCalendar1.EventText(Now, CSPrimaryEvent)
- End Sub
- Private Sub Form_Load()
- On Error Resume Next
- ' Load the data file and show the current date's events in text box
- CSCalendar1.DatesFromURL = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "sample.dat"
- If CSCalendar1.EventText(Now, CSPrimaryEvent) = "" Then
- txtEvent.Text = "No events are scheduled for today."
- Else
- txtEvent.Text = CSCalendar1.EventText(Now, CSPrimaryEvent)
- End If
- End Sub
- Public Sub SaveData(ByVal newName As String)
- Dim lFile As Long
- Dim sTemp As String
- lFile = FreeFile
- CSCalendar1.CopyToClipboard
- Open newName For Output As #lFile
- Print #lFile, Clipboard.GetText
- Close #lFile
- Clipboard.Clear
- End Sub
- Private Sub mnuFileExit_Click()
- End
- End Sub
- Private Sub mnuFileSave_Click()
- SaveData IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "sample.dat"
- End Sub
-