home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sample / sample.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-01-06  |  5.9 KB  |  173 lines

  1. VERSION 5.00
  2. Object = "{415A09B4-D805-11D0-B7C8-444553540000}#1.1#0"; "CSCALBTN.OCX"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Computer Simple Calendar Sample"
  6.    ClientHeight    =   3525
  7.    ClientLeft      =   4185
  8.    ClientTop       =   3315
  9.    ClientWidth     =   6375
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3525
  14.    ScaleWidth      =   6375
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.CommandButton Command2 
  17.       Caption         =   "Save"
  18.       Height          =   375
  19.       Left            =   3900
  20.       TabIndex        =   2
  21.       Top             =   2940
  22.       Width           =   975
  23.    End
  24.    Begin VB.CommandButton Command1 
  25.       Caption         =   "Close"
  26.       Height          =   375
  27.       Left            =   5160
  28.       TabIndex        =   3
  29.       Top             =   2940
  30.       Width           =   975
  31.    End
  32.    Begin VB.TextBox txtEvent 
  33.       Alignment       =   2  'Center
  34.       Appearance      =   0  'Flat
  35.       BorderStyle     =   0  'None
  36.       Enabled         =   0   'False
  37.       Height          =   2235
  38.       Left            =   3840
  39.       MultiLine       =   -1  'True
  40.       ScrollBars      =   2  'Vertical
  41.       TabIndex        =   0
  42.       TabStop         =   0   'False
  43.       Top             =   600
  44.       Width           =   2355
  45.    End
  46.    Begin CalendarBtn.CSCalendar CSCalendar1 
  47.       Height          =   3195
  48.       Left            =   240
  49.       TabIndex        =   1
  50.       Top             =   180
  51.       Width           =   3495
  52.       _ExtentX        =   6165
  53.       _ExtentY        =   5636
  54.       ShowSelectMenu  =   0   'False
  55.       Caption         =   "Computer Simple"
  56.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  57.          Name            =   "MS Sans Serif"
  58.          Size            =   8.25
  59.          Charset         =   0
  60.          Weight          =   400
  61.          Underline       =   0   'False
  62.          Italic          =   0   'False
  63.          Strikethrough   =   0   'False
  64.       EndProperty
  65.       BeginProperty DaysFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  66.          Name            =   "MS Sans Serif"
  67.          Size            =   8.25
  68.          Charset         =   0
  69.          Weight          =   400
  70.          Underline       =   0   'False
  71.          Italic          =   0   'False
  72.          Strikethrough   =   0   'False
  73.       EndProperty
  74.       BeginProperty ButtonFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  75.          Name            =   "MS Sans Serif"
  76.          Size            =   8.25
  77.          Charset         =   0
  78.          Weight          =   700
  79.          Underline       =   0   'False
  80.          Italic          =   0   'False
  81.          Strikethrough   =   0   'False
  82.       EndProperty
  83.       BeginProperty CellFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  84.          Name            =   "MS Sans Serif"
  85.          Size            =   8.25
  86.          Charset         =   0
  87.          Weight          =   400
  88.          Underline       =   0   'False
  89.          Italic          =   0   'False
  90.          Strikethrough   =   0   'False
  91.       EndProperty
  92.       BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  93.          Name            =   "MS Sans Serif"
  94.          Size            =   9.75
  95.          Charset         =   0
  96.          Weight          =   700
  97.          Underline       =   0   'False
  98.          Italic          =   0   'False
  99.          Strikethrough   =   0   'False
  100.       EndProperty
  101.       WeekendTransparent=   0   'False
  102.    End
  103.    Begin VB.Label Label1 
  104.       Alignment       =   2  'Center
  105.       Caption         =   "Today's Events"
  106.       BeginProperty Font 
  107.          Name            =   "MS Sans Serif"
  108.          Size            =   12
  109.          Charset         =   0
  110.          Weight          =   700
  111.          Underline       =   0   'False
  112.          Italic          =   0   'False
  113.          Strikethrough   =   0   'False
  114.       EndProperty
  115.       Height          =   315
  116.       Left            =   3840
  117.       TabIndex        =   4
  118.       Top             =   180
  119.       Width           =   2295
  120.    End
  121.    Begin VB.Menu mnuFile 
  122.       Caption         =   "&File"
  123.       Begin VB.Menu mnuFileSave 
  124.          Caption         =   "Save"
  125.       End
  126.       Begin VB.Menu mnuFileExit 
  127.          Caption         =   "Exit"
  128.       End
  129.    End
  130. Attribute VB_Name = "Form1"
  131. Attribute VB_GlobalNameSpace = False
  132. Attribute VB_Creatable = False
  133. Attribute VB_PredeclaredId = True
  134. Attribute VB_Exposed = False
  135. Private Sub Command1_Click()
  136.     End
  137. End Sub
  138. Private Sub Command2_Click()
  139.     SaveData IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "sample.dat"
  140. End Sub
  141. Private Sub CSCalendar1_DateSelected(ByVal New_Date As Variant)
  142. On Error Resume Next
  143. ' Add/Edit a primary event
  144.     CSCalendar1.ShowInputDialog New_Date, CSPrimaryEvent
  145.     txtEvent.Text = CSCalendar1.EventText(Now, CSPrimaryEvent)
  146. End Sub
  147. Private Sub Form_Load()
  148. On Error Resume Next
  149. ' Load the data file and show the current date's events in text box
  150.     CSCalendar1.DatesFromURL = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "sample.dat"
  151.     If CSCalendar1.EventText(Now, CSPrimaryEvent) = "" Then
  152.         txtEvent.Text = "No events are scheduled for today."
  153.     Else
  154.         txtEvent.Text = CSCalendar1.EventText(Now, CSPrimaryEvent)
  155.     End If
  156. End Sub
  157. Public Sub SaveData(ByVal newName As String)
  158.     Dim lFile As Long
  159.     Dim sTemp As String
  160.     lFile = FreeFile
  161.     CSCalendar1.CopyToClipboard
  162.     Open newName For Output As #lFile
  163.     Print #lFile, Clipboard.GetText
  164.     Close #lFile
  165.     Clipboard.Clear
  166. End Sub
  167. Private Sub mnuFileExit_Click()
  168.     End
  169. End Sub
  170. Private Sub mnuFileSave_Click()
  171.     SaveData IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "sample.dat"
  172. End Sub
  173.