home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
holcal.zip
/
HOLSMPL.FRM
< prev
next >
Wrap
Text File
|
1995-03-28
|
4KB
|
134 lines
VERSION 2.00
Begin Form FormSimple
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Simplest Call to Holiday Calendar"
ClientHeight = 2715
ClientLeft = 765
ClientTop = 3750
ClientWidth = 5205
ControlBox = 0 'False
Height = 3120
Left = 705
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2715
ScaleWidth = 5205
Top = 3405
Width = 5325
Begin CommandButton CommandMinimize
Cancel = -1 'True
Caption = "&Minimize"
Height = 495
Left = 3120
TabIndex = 5
Top = 2040
Width = 975
End
Begin CommandButton CommandExit
Caption = "E&xit"
Height = 495
Left = 4200
TabIndex = 2
Top = 2040
Width = 855
End
Begin CommandButton CommandLink
Caption = "&Link to the Holiday Calendar"
Default = -1 'True
Height = 495
Left = 120
TabIndex = 1
Top = 2040
Width = 2895
End
Begin TextBox Text1
Height = 285
Left = 120
TabIndex = 0
Text = " Date Box"
Top = 120
Width = 4935
End
Begin Label Label2
Alignment = 2 'Center
BackColor = &H80000002&
BorderStyle = 1 'Fixed Single
Caption = " Message Box"
ForeColor = &H80000009&
Height = 750
Left = 120
TabIndex = 4
Top = 1200
Width = 4935
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H80000002&
BorderStyle = 1 'Fixed Single
Caption = " Status Box"
ForeColor = &H80000009&
Height = 630
Left = 120
TabIndex = 3
Top = 480
Width = 4935
End
End
' HolSmpl.Frm - Simplest example of linking to the Holiday Calendar
' 95/02/19 Copyright 1995, Larry Rebich, The Bridge, Inc.
Option Explicit
DefInt A-Z
Sub CommandExit_Click ()
' Ending...
' HCL_CLOSECALENDAR causes it to end if we started it
Dim Rtn As Integer
Rtn = HCL_LinkToCalendar(Text1, Label1, Label2, HCL_CLOSECALENDAR)
End 'done, bye
End Sub
Sub CommandLink_Click ()
' connect to the Holiday Calendar
Dim Rtn As Integer
If HCL_LinkToCalendar(Text1, Label1, Label2, HCL_FORCESTART) Then
CommandMinimize.Enabled = True
Else
CommandMinimize.Enabled = False
End If
End Sub
Sub CommandMinimize_Click ()
' Minimize the Holiday Calendar
Dim Rtn As Integer
Rtn = HCL_LinkToCalendar(Text1, Label1, Label2, HCL_MINIMIZE)
End Sub
Sub Form_Load ()
' begin
Move 10, (Screen.Height - Height) \ 2 'locate the form
Text1 = Format$(Now, "Short Date") 'today is the starting date
' Link to the calendar if it is already running,
' HCL_FORCESTARTNO skips link if it is not running.
Dim Rtn As Integer
If HCL_LinkToCalendar(Text1, Label1, Label2, HCL_LINKIFSTARTED) Then
CommandMinimize.Enabled = True
Else
CommandMinimize.Enabled = False
End If
End Sub
Sub Text1_KeyPress (KeyAscii As Integer)
' User presses Enter and causes the date to be passed to the calendar.
' The user could enter any date then press enter.
' A Bad Date message is returned if the date is invalid.
If KeyAscii = 13 Then 'Enter pressed
KeyAscii = 0 'no beep
CommandLink_Click 'force sending of date to the calendar
End If
End Sub