home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhalrm / mhalrm.bas < prev    next >
Encoding:
BASIC Source File  |  1995-11-30  |  717 b   |  37 lines

  1. Attribute VB_Name = "DemoMain"
  2. Option Explicit 'always
  3. Public Sub CenterForm(x_YourForm As Form)
  4.  
  5.  
  6.     ' center the passed form to screen
  7.     x_YourForm.Move Abs(Screen.Width - x_YourForm.Width) \ 2, Abs(Screen.Height - x_YourForm.Height) \ 2
  8.     
  9.     
  10. End Sub
  11. Public Sub Main()
  12.  
  13.  
  14.     ' let's run the demo!
  15.     Screen.MousePointer = vbHourglass
  16.     Load frmMhAlarm_OCX
  17.     frmMhAlarm_OCX.Show
  18.     Screen.MousePointer = vbDefault
  19.     
  20.     
  21. End Sub
  22. ' This method closes the demo program safely
  23. Public Sub ProgramExit()
  24.  
  25.  
  26.     ' unload all forms
  27.     Dim TempForm As Form
  28.     For Each TempForm In Forms
  29.         Unload TempForm
  30.     Next TempForm
  31.     
  32.     ' end program
  33.     End
  34.  
  35.  
  36. End Sub
  37.