Professional Documents
Culture Documents
Time
labels:
Private Sub Form_Load()
'center the form:
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
'display date & time
lblDate.Caption = Format$(Date, "m/d/yyyy")
lblTime.Caption = Format$(Time, "h:nn AM/PM")
End Sub
The Click event for the Print button (cmdPrint_Click) hides the two command buttons (by setting their
Visible properties to False), issues the PrintForm statement, then makes the buttons visible again:
The Click event for the Exit button (cmdExit_Click) ends the program by issuing the End command.