home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / holcal.zip / HOLSMPL.FRM < prev    next >
Text File  |  1995-03-28  |  4KB  |  134 lines

  1. VERSION 2.00
  2. Begin Form FormSimple 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Simplest Call to Holiday Calendar"
  6.    ClientHeight    =   2715
  7.    ClientLeft      =   765
  8.    ClientTop       =   3750
  9.    ClientWidth     =   5205
  10.    ControlBox      =   0   'False
  11.    Height          =   3120
  12.    Left            =   705
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2715
  17.    ScaleWidth      =   5205
  18.    Top             =   3405
  19.    Width           =   5325
  20.    Begin CommandButton CommandMinimize 
  21.       Cancel          =   -1  'True
  22.       Caption         =   "&Minimize"
  23.       Height          =   495
  24.       Left            =   3120
  25.       TabIndex        =   5
  26.       Top             =   2040
  27.       Width           =   975
  28.    End
  29.    Begin CommandButton CommandExit 
  30.       Caption         =   "E&xit"
  31.       Height          =   495
  32.       Left            =   4200
  33.       TabIndex        =   2
  34.       Top             =   2040
  35.       Width           =   855
  36.    End
  37.    Begin CommandButton CommandLink 
  38.       Caption         =   "&Link to the Holiday Calendar"
  39.       Default         =   -1  'True
  40.       Height          =   495
  41.       Left            =   120
  42.       TabIndex        =   1
  43.       Top             =   2040
  44.       Width           =   2895
  45.    End
  46.    Begin TextBox Text1 
  47.       Height          =   285
  48.       Left            =   120
  49.       TabIndex        =   0
  50.       Text            =   " Date Box"
  51.       Top             =   120
  52.       Width           =   4935
  53.    End
  54.    Begin Label Label2 
  55.       Alignment       =   2  'Center
  56.       BackColor       =   &H80000002&
  57.       BorderStyle     =   1  'Fixed Single
  58.       Caption         =   " Message Box"
  59.       ForeColor       =   &H80000009&
  60.       Height          =   750
  61.       Left            =   120
  62.       TabIndex        =   4
  63.       Top             =   1200
  64.       Width           =   4935
  65.    End
  66.    Begin Label Label1 
  67.       Alignment       =   2  'Center
  68.       BackColor       =   &H80000002&
  69.       BorderStyle     =   1  'Fixed Single
  70.       Caption         =   " Status Box"
  71.       ForeColor       =   &H80000009&
  72.       Height          =   630
  73.       Left            =   120
  74.       TabIndex        =   3
  75.       Top             =   480
  76.       Width           =   4935
  77.    End
  78. End
  79. ' HolSmpl.Frm - Simplest example of linking to the Holiday Calendar
  80. ' 95/02/19 Copyright 1995, Larry Rebich, The Bridge, Inc.
  81.  
  82.     Option Explicit
  83.     DefInt A-Z
  84.  
  85. Sub CommandExit_Click ()
  86. ' Ending...
  87.     ' HCL_CLOSECALENDAR causes it to end if we started it
  88.     Dim Rtn As Integer
  89.     Rtn = HCL_LinkToCalendar(Text1, Label1, Label2, HCL_CLOSECALENDAR)
  90.     End         'done, bye
  91. End Sub
  92.  
  93. Sub CommandLink_Click ()
  94. ' connect to the Holiday Calendar
  95.     Dim Rtn As Integer
  96.     If HCL_LinkToCalendar(Text1, Label1, Label2, HCL_FORCESTART) Then
  97.         CommandMinimize.Enabled = True
  98.     Else
  99.         CommandMinimize.Enabled = False
  100.     End If
  101. End Sub
  102.  
  103. Sub CommandMinimize_Click ()
  104. ' Minimize the Holiday Calendar
  105.     Dim Rtn As Integer
  106.     Rtn = HCL_LinkToCalendar(Text1, Label1, Label2, HCL_MINIMIZE)
  107. End Sub
  108.  
  109. Sub Form_Load ()
  110. ' begin
  111.     Move 10, (Screen.Height - Height) \ 2   'locate the form
  112.     Text1 = Format$(Now, "Short Date")      'today is the starting date
  113.     
  114.     ' Link to the calendar if it is already running,
  115.     ' HCL_FORCESTARTNO skips link if it is not running.
  116.     Dim Rtn As Integer
  117.     If HCL_LinkToCalendar(Text1, Label1, Label2, HCL_LINKIFSTARTED) Then
  118.         CommandMinimize.Enabled = True
  119.     Else
  120.         CommandMinimize.Enabled = False
  121.     End If
  122. End Sub
  123.  
  124. Sub Text1_KeyPress (KeyAscii As Integer)
  125. ' User presses Enter and causes the date to be passed to the calendar.
  126. ' The user could enter any date then press enter.
  127. ' A Bad Date message is returned if the date is invalid.
  128.     If KeyAscii = 13 Then   'Enter pressed
  129.         KeyAscii = 0        'no beep
  130.         CommandLink_Click      'force sending of date to the calendar
  131.     End If
  132. End Sub
  133.  
  134.