home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhalrm / mhalrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-30  |  26.1 KB  |  654 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMhAlarm_OCX 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "MicroHelp MhAlarm Example"
  5.    ClientHeight    =   3720
  6.    ClientLeft      =   2700
  7.    ClientTop       =   2148
  8.    ClientWidth     =   5568
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   7.8
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   4320
  20.    Icon            =   "MHALRM.frx":0000
  21.    KeyPreview      =   -1  'True
  22.    Left            =   2652
  23.    LinkTopic       =   "Form1"
  24.    ScaleHeight     =   3720
  25.    ScaleWidth      =   5568
  26.    Top             =   1596
  27.    Width           =   5664
  28.    Begin VB.Frame fraProperties 
  29.       Caption         =   "Lets see what this control can do..."
  30.       Height          =   2712
  31.       Left            =   180
  32.       TabIndex        =   7
  33.       Tag             =   "slide frame"
  34.       Top             =   3924
  35.       Width           =   5412
  36.       Begin VB.Frame Frame2 
  37.          Height          =   2388
  38.          Left            =   144
  39.          TabIndex        =   19
  40.          Top             =   180
  41.          Width           =   5124
  42.          Begin VB.Label Label1 
  43.             Alignment       =   2  'Center
  44.             BackStyle       =   0  'Transparent
  45.             Caption         =   "Right-click on me to set my properties..."
  46.             Height          =   264
  47.             Left            =   72
  48.             TabIndex        =   21
  49.             Top             =   1512
  50.             Width           =   4980
  51.          End
  52.          Begin Mhal200Lib.MhIAlarm MhIAlarmPropertyTester 
  53.             Height          =   384
  54.             Left            =   2376
  55.             TabIndex        =   20
  56.             TabStop         =   0   'False
  57.             Top             =   1008
  58.             Width           =   384
  59.             _Version        =   65536
  60.             _ExtentX        =   677
  61.             _ExtentY        =   677
  62.             _StockProps     =   65
  63.             TintColor       =   16711935
  64.             Style           =   0
  65.             Autosize        =   -1  'True
  66.             RingTime        =   1000
  67.             PauseTime       =   1000
  68.             RingTone        =   41
  69.             RingMode        =   2
  70.             RingLength      =   34
  71.             RingOn          =   0
  72.             WaveSource      =   0
  73.             Interval        =   29
  74.             WindowState     =   0
  75.             WaveName        =   "Telephone"
  76.          End
  77.       End
  78.    End
  79.    Begin VB.Frame fraTheLook 
  80.       Caption         =   "The MhAlarm control has some cool styles..."
  81.       Height          =   2712
  82.       Left            =   72
  83.       TabIndex        =   3
  84.       Tag             =   "slide frame"
  85.       Top             =   36
  86.       Width           =   5412
  87.       Begin VB.Frame Frame1 
  88.          Height          =   2388
  89.          Left            =   144
  90.          TabIndex        =   8
  91.          Top             =   180
  92.          Width           =   5124
  93.          Begin Mhal200Lib.MhIAlarm MhAlarm1 
  94.             Height          =   384
  95.             Index           =   1
  96.             Left            =   2376
  97.             TabIndex        =   17
  98.             TabStop         =   0   'False
  99.             Top             =   1008
  100.             Width           =   384
  101.             _Version        =   65536
  102.             _ExtentX        =   677
  103.             _ExtentY        =   677
  104.             _StockProps     =   65
  105.             TintColor       =   16711935
  106.             Style           =   1
  107.             Autosize        =   -1  'True
  108.             RingTime        =   2000
  109.             PauseTime       =   0
  110.             RingTone        =   45
  111.             RingMode        =   2
  112.             RingLength      =   32
  113.             RingOn          =   0
  114.             WaveSource      =   0
  115.             Interval        =   50
  116.             WindowState     =   0
  117.             WaveName        =   "AlarmClock"
  118.          End
  119.          Begin Mhal200Lib.MhIAlarm MhAlarm2 
  120.             Height          =   384
  121.             Index           =   0
  122.             Left            =   864
  123.             TabIndex        =   16
  124.             TabStop         =   0   'False
  125.             Top             =   1008
  126.             Width           =   384
  127.             _Version        =   65536
  128.             _ExtentX        =   677
  129.             _ExtentY        =   677
  130.             _StockProps     =   65
  131.             TintColor       =   16711935
  132.             Style           =   0
  133.             Autosize        =   -1  'True
  134.             RingTime        =   1000
  135.             PauseTime       =   1000
  136.             RingTone        =   41
  137.             RingMode        =   2
  138.             RingLength      =   34
  139.             RingOn          =   0
  140.             WaveSource      =   0
  141.             Interval        =   29
  142.             WindowState     =   0
  143.             WaveName        =   "Telephone"
  144.          End
  145.          Begin Mhal200Lib.MhIAlarm MhIAlarmDemo 
  146.             Height          =   384
  147.             Index           =   2
  148.             Left            =   3636
  149.             TabIndex        =   15
  150.             TabStop         =   0   'False
  151.             Top             =   1008
  152.             Width           =   384
  153.             _Version        =   65536
  154.             _ExtentX        =   677
  155.             _ExtentY        =   677
  156.             _StockProps     =   65
  157.             TintColor       =   16711935
  158.             Style           =   2
  159.             Autosize        =   -1  'True
  160.             RingTime        =   1000
  161.             PauseTime       =   1000
  162.             RingTone        =   72
  163.             RingMode        =   0
  164.             RingLength      =   34
  165.             RingOn          =   0
  166.             WaveSource      =   0
  167.             Interval        =   29
  168.             WindowState     =   0
  169.             WaveName        =   "Wristwatch"
  170.          End
  171.          Begin VB.Label Label2 
  172.             Alignment       =   2  'Center
  173.             Caption         =   "El Tel
  174. phono"
  175.             Height          =   228
  176.             Left            =   504
  177.             TabIndex        =   14
  178.             Top             =   684
  179.             Width           =   1236
  180.          End
  181.          Begin VB.Label Label3 
  182.             Alignment       =   2  'Center
  183.             Caption         =   "As-Saa'a"
  184.             Height          =   228
  185.             Left            =   3312
  186.             TabIndex        =   13
  187.             Top             =   684
  188.             Width           =   1092
  189.          End
  190.          Begin VB.Label Label4 
  191.             Alignment       =   2  'Center
  192.             Caption         =   "Une Cloche"
  193.             Height          =   228
  194.             Left            =   2052
  195.             TabIndex        =   12
  196.             Top             =   684
  197.             Width           =   1092
  198.          End
  199.          Begin VB.Label Label5 
  200.             Alignment       =   2  'Center
  201.             Caption         =   "Wrist Watch"
  202.             Height          =   228
  203.             Left            =   3168
  204.             TabIndex        =   11
  205.             Top             =   1548
  206.             Width           =   1416
  207.          End
  208.          Begin VB.Label Label6 
  209.             Alignment       =   2  'Center
  210.             Caption         =   "Clock"
  211.             Height          =   228
  212.             Left            =   2052
  213.             TabIndex        =   10
  214.             Top             =   1548
  215.             Width           =   1020
  216.          End
  217.          Begin VB.Label Label7 
  218.             Alignment       =   2  'Center
  219.             Caption         =   "Telephone"
  220.             Height          =   228
  221.             Left            =   540
  222.             TabIndex        =   9
  223.             Top             =   1548
  224.             Width           =   1092
  225.          End
  226.       End
  227.    End
  228.    Begin VB.CommandButton cmdSlide 
  229.       Appearance      =   0  'Flat
  230.       BackColor       =   &H00D9A8AE&
  231.       Caption         =   "< &Back"
  232.       Enabled         =   0   'False
  233.       BeginProperty Font 
  234.          name            =   "MS Sans Serif"
  235.          charset         =   0
  236.          weight          =   400
  237.          size            =   7.8
  238.          underline       =   0   'False
  239.          italic          =   0   'False
  240.          strikethrough   =   0   'False
  241.       EndProperty
  242.       Height          =   372
  243.       Index           =   0
  244.       Left            =   888
  245.       TabIndex        =   0
  246.       Top             =   2904
  247.       Width           =   1212
  248.    End
  249.    Begin VB.CommandButton cmdSlide 
  250.       Appearance      =   0  'Flat
  251.       BackColor       =   &H00D9A8AE&
  252.       Caption         =   "&Next >"
  253.       Default         =   -1  'True
  254.       BeginProperty Font 
  255.          name            =   "MS Sans Serif"
  256.          charset         =   0
  257.          weight          =   400
  258.          size            =   7.8
  259.          underline       =   0   'False
  260.          italic          =   0   'False
  261.          strikethrough   =   0   'False
  262.       EndProperty
  263.       Height          =   372
  264.       Index           =   1
  265.       Left            =   2088
  266.       TabIndex        =   1
  267.       Top             =   2904
  268.       Width           =   1212
  269.    End
  270.    Begin VB.CommandButton cmdClose 
  271.       Appearance      =   0  'Flat
  272.       BackColor       =   &H00D9A8AE&
  273.       Caption         =   "&Close"
  274.       BeginProperty Font 
  275.          name            =   "MS Sans Serif"
  276.          charset         =   0
  277.          weight          =   400
  278.          size            =   7.8
  279.          underline       =   0   'False
  280.          italic          =   0   'False
  281.          strikethrough   =   0   'False
  282.       EndProperty
  283.       Height          =   372
  284.       Left            =   3384
  285.       TabIndex        =   2
  286.       Top             =   2916
  287.       Width           =   1212
  288.    End
  289.    Begin VB.Timer tmrStatusLine 
  290.       Enabled         =   0   'False
  291.       Left            =   432
  292.       Top             =   2916
  293.    End
  294.    Begin Threed.SSPanel panStatusLine 
  295.       Height          =   240
  296.       Left            =   72
  297.       TabIndex        =   6
  298.       Top             =   3384
  299.       Width           =   5412
  300.       _Version        =   65536
  301.       _ExtentX        =   9546
  302.       _ExtentY        =   423
  303.       _StockProps     =   15
  304.       Caption         =   "Ready..."
  305.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  306.          name            =   "MS Sans Serif"
  307.          charset         =   0
  308.          weight          =   400
  309.          size            =   7.8
  310.          underline       =   0   'False
  311.          italic          =   0   'False
  312.          strikethrough   =   0   'False
  313.       EndProperty
  314.       BevelOuter      =   1
  315.    End
  316.    Begin Threed.SSPanel SSPanel1 
  317.       Height          =   24
  318.       Left            =   -1224
  319.       TabIndex        =   18
  320.       Top             =   0
  321.       Width           =   8400
  322.       _Version        =   65536
  323.       _ExtentX        =   14817
  324.       _ExtentY        =   42
  325.       _StockProps     =   15
  326.       Caption         =   "SSPanel1"
  327.       BackColor       =   12038095
  328.       BevelOuter      =   1
  329.    End
  330.    Begin VB.Frame fraTipsAndTricks 
  331.       Caption         =   "Tips and Tricks..."
  332.       Height          =   2712
  333.       Left            =   72
  334.       TabIndex        =   4
  335.       Tag             =   "slide frame"
  336.       Top             =   3708
  337.       Width           =   5412
  338.       Begin VB.TextBox txtTipsAndTricks 
  339.          Height          =   2352
  340.          Left            =   108
  341.          Locked          =   -1  'True
  342.          MultiLine       =   -1  'True
  343.          ScrollBars      =   2  'Vertical
  344.          TabIndex        =   5
  345.          Top             =   252
  346.          Width           =   5172
  347.       End
  348.    End
  349.    Begin VB.Menu mnuFile 
  350.       Caption         =   "&File"
  351.       Begin VB.Menu mnuFileExit 
  352.          Caption         =   "E&xit"
  353.       End
  354.    End
  355.    Begin VB.Menu mnuAbout 
  356.       Caption         =   "&About..."
  357.    End
  358.    Begin VB.Menu mnuContextMenus 
  359.       Caption         =   "Context Menus"
  360.       Visible         =   0   'False
  361.       Begin VB.Menu mnuMhAlarmContextMenu 
  362.          Caption         =   "Context Menu for MhAlarmPropertyTester"
  363.          Begin VB.Menu mnuMhAlarmContextMenu_About 
  364.             Caption         =   "&About Control..."
  365.          End
  366.          Begin VB.Menu mnuMhAlarmContextMenu_Close 
  367.             Caption         =   "&Close"
  368.          End
  369.          Begin VB.Menu mnuMhAlarmContextMenu_Sep1 
  370.             Caption         =   "-"
  371.          End
  372.          Begin VB.Menu mnuMhAlarmContextMenu_Properties 
  373.             Caption         =   "&Properties"
  374.          End
  375.       End
  376.    End
  377. Attribute VB_Name = "frmMhAlarm_OCX"
  378. Attribute VB_Creatable = False
  379. Attribute VB_Exposed = False
  380. Option Explicit ' always
  381. ' to keep track of the currently selected slide (view), number of slide-frames used in demo.
  382. Private iCurrentSlide As Byte, iNumberOfSlides As Byte
  383. ' This procedure sets the percent complete status line of the demo's interface
  384. '   form.
  385. '   iProgress - value to set indicate percent complete of operation.
  386. '       If a value of <0 or > 100 is passed the status line is cleared and reset
  387. Public Sub SetStatusBarProgress(iProgress As Byte)
  388.     Dim StatusBar As Control
  389.     ' set reference to status line on form
  390.     Set StatusBar = panStatusLine
  391.     Select Case iProgress
  392.     Case 0 To 100
  393.         ' set the status line flood type if not already set
  394.         If StatusBar.FloodType <> 1 Then StatusBar.FloodType = 1
  395.         ' set the value of the percent complete
  396.         StatusBar.FloodPercent = iProgress
  397.     Case Else
  398.         ' value is outside of valid range so reset status line
  399.         StatusBar.FloodType = 0
  400.         StatusBar.FloodPercent = 0
  401.     End Select
  402. End Sub
  403. Private Sub cmdClose_Click()
  404.     ' unload this form
  405.     Unload Me
  406. End Sub
  407. Private Sub cmdSlide_Click(Index As Integer)
  408.     ' determine the button that the user pressed
  409.     Select Case Index
  410.     Case 0 ' Go Back
  411.        ShowSlidePrevious
  412.     Case 1 ' Go to Next slide
  413.        ShowSlideNext
  414.     End Select
  415. End Sub
  416. Private Sub Form_Load()
  417.     Screen.MousePointer = vbHourglass
  418.     Dim iDisplaySlideLeft As Integer, iDisplaySlideTop As Integer
  419.     ' place all display frames in the same location as the first frame
  420.     iDisplaySlideTop = fraTheLook.Top
  421.     iDisplaySlideLeft = fraTheLook.Left
  422.     Dim TempControl As Control
  423.     For Each TempControl In Me.Controls
  424.         If TypeOf TempControl Is Frame Then
  425.             If TempControl.Tag = "slide frame" Then ' frames used as slides have their .Tag properties set to "slide frame"
  426.                 TempControl.Left = iDisplaySlideLeft
  427.                 TempControl.Top = iDisplaySlideTop
  428.             End If
  429.         End If
  430.     Next TempControl
  431.     ' center the form to the screen using the parent object's CenterForm method
  432.     Call DemoMain.CenterForm(Me)
  433.     ' set backcolor of various controls to match current Windows 3D settings
  434.     'Call DemoMain.Set3dColors(Me)
  435.     ' we use 3 slide (views) for this demo
  436.     iNumberOfSlides = 3
  437.     ' show the demo's first slide (view)
  438.     ShowSlideNext
  439.     ' greet the user warmly!
  440.     Dim sGreeting As String
  441.     Randomize (Timer)
  442.     Select Case Int(Rnd * 4)
  443.     Case 0
  444.         sGreeting = "Howdi programmer..."
  445.     Case 1
  446.         sGreeting = "Hi there..."
  447.     Case 2
  448.         sGreeting = "It's MhAlarm Time!"
  449.     Case Else
  450.         sGreeting = "Welcome to the MicroHelp MhAlarm Demo!"
  451.     End Select
  452.     Call SetStatusLineText(sGreeting, 4001, True)
  453.     Screen.MousePointer = vbDefault
  454. End Sub
  455. ' This procedure sets the status line text to the text in sMessageText parameter
  456. '   and keeps the text there for the time period specified (in milliseconds) by the
  457. '   vTimePeriod parameter.  This procedure uses the timer on the demo's mDemoFace form to
  458. '   get a callback when the vTimePeriod has elapsed.
  459. '   sMessageText - text to be displayed
  460. '   [vTimePeriod] - time period (in milliseconds) to display the message.  If not specfied a value
  461. '       of 3000 is used.
  462. '   [vOverRide] - when set to True the sMessageText is displayed immediately even if there is a
  463. '       message currently being displayed.  If set to False (or not specified) and there is a message
  464. '       being displayed the new message is placed in a single item queue and displayed when the time
  465. '       period of the previous message has expired.
  466. Public Sub SetStatusLineText(sMessageText As String, Optional vTimePeriod As Variant, Optional vOverRide As Variant)
  467.     Static sQueueText As String, iQueueTimePeriod As Integer, bQueueIsEmpty As Boolean
  468.     Dim oStatusLine As Control, oStatusLineTimer As Timer
  469.     ' set references to controls on the m_DemoFace form
  470.     Set oStatusLine = panStatusLine
  471.     Set oStatusLineTimer = tmrStatusLine
  472.     ' if the calling procedure did not specify a display time (or set it to <.5 seconds) then default the time to 3 seconds
  473.     Select Case True
  474.     Case IsMissing(vTimePeriod), vTimePeriod <= 500
  475.         vTimePeriod = 3000
  476.     End Select
  477.     ' if the calling procedure did not specify an vOverRide value then set vOverRide to False
  478.     If IsMissing(vOverRide) Then vOverRide = False
  479.     ' if this procedure was called by the timer then turn the timer off and check queue.  If it was not called by the timer
  480.     '   then there is a new message to display.
  481.     If sMessageText = "_timer_calling_" Then
  482.         ' If there is nothing in the queue then reset the status line text to "Ready".
  483.         '   Otherwise, display the message which is in the queue
  484.         oStatusLineTimer.Enabled = False ' turn timer off
  485.         If bQueueIsEmpty Then
  486.             ' reset status line text
  487.             oStatusLine.Caption = "Ready..."
  488.         Else
  489.              ' display message which is in the queue
  490.              oStatusLine.Caption = sQueueText
  491.             ' setup timer to call this procedure when the iQueueTimePeriod has expired
  492.             oStatusLineTimer.Interval = iQueueTimePeriod
  493.             sQueueText = "" ' clear queue text
  494.             iQueueTimePeriod = 0 ' clear queue time period
  495.             bQueueIsEmpty = True ' the queue is now empty so let's indicate this fact
  496.             oStatusLineTimer.Enabled = True
  497.        End If
  498.     Else
  499.         ' if the timer is enabled then there is already a message being displayed so place
  500.         '   this new message in the single item queue.  But, if this is an over-ride then
  501.         '   show the message now
  502.         If oStatusLineTimer.Enabled And Not vOverRide Then
  503.             sQueueText = sMessageText
  504.             iQueueTimePeriod = vTimePeriod
  505.             bQueueIsEmpty = False
  506.         Else
  507.             ' over-ride the currently displayed message
  508.             oStatusLineTimer.Enabled = False
  509.             sQueueText = "" ' clear queue text
  510.             iQueueTimePeriod = 0 ' clear queue time period
  511.             bQueueIsEmpty = True ' the queue is now empty so let's indicate this fact
  512.             oStatusLine.Caption = sMessageText
  513.             ' setup timer to call this procedure when the vTimePeriod has expired
  514.             oStatusLineTimer.Interval = vTimePeriod
  515.             oStatusLineTimer.Enabled = True
  516.         End If
  517.     End If
  518. End Sub
  519. Private Sub Form_Unload(Cancel As Integer)
  520.     ' close down this demo
  521.    DemoMain.ProgramExit
  522. End Sub
  523. ' This method moves to the demo's next slide if not already on the last slide
  524. Public Sub ShowSlideNext()
  525.     ' if we are not on the last slide then choose the next slide as the current slide
  526.     If iCurrentSlide < iNumberOfSlides Then iCurrentSlide = iCurrentSlide + 1
  527.     ' have the user interface move to this new slide (view)
  528.     SetupFrames (iCurrentSlide)
  529. End Sub
  530. ' This method returns to the demo's previous slide if not already on the first slide
  531. Public Sub ShowSlidePrevious()
  532.     ' if we are not on the first slide then make the previouse slide the current slide
  533.     If iCurrentSlide >= 1 Then iCurrentSlide = iCurrentSlide - 1
  534.     ' have the user interface move to this new slide (view)
  535.     SetupFrames (iCurrentSlide)
  536. End Sub
  537. Public Sub ShowAbout()
  538.     Screen.MousePointer = vbHourglass
  539.     frmAbout.Show
  540.     Screen.MousePointer = vbDefault
  541. End Sub
  542. Private Sub MhIAlarmDemo_Click(Index As Integer)
  543.     ' tell user that an alarm was clicked
  544.     Call SetStatusLineText("An MhAlarm control was clicked...")
  545. End Sub
  546. Private Sub MhIAlarmPropertyTester_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  547.     ' if the user right clicked on control then show the popup menu for this control
  548.     If Button And vbRightButton Then Me.PopupMenu mnuMhAlarmContextMenu
  549.     ' tell user that the alarm was clicked
  550.     Call SetStatusLineText("An MhAlarm control was clicked...")
  551. End Sub
  552. Private Sub mnuAbout_Click()
  553.     ' tell user about the demo by invoking the parent object's ShowAbout method
  554.    ShowAbout
  555. End Sub
  556. Private Sub mnuFileExit_Click()
  557.     ' unload form
  558.     Unload Me
  559. End Sub
  560. ' This procedure sets up the different views according to the SlideNumber parameter
  561. Public Sub SetupFrames(SlideNumber As Integer)
  562.     On Error GoTo SetupFrames_Error
  563.         
  564.     Dim oCurrentFrame As Frame
  565.     Dim sMessageText  As String
  566.     ' enabled/disable the appropriate buttons according to our slide number
  567.     Select Case True
  568.     Case SlideNumber <= 1 ' we are at first slide
  569.         ' disable the 'back' button
  570.         cmdSlide(0).Enabled = False
  571.         cmdSlide(1).SetFocus
  572.     Case SlideNumber >= iNumberOfSlides ' we are at last slide
  573.         ' disable the 'next' button
  574.         cmdSlide(1).Enabled = False
  575.         cmdSlide(0).SetFocus
  576.     Case Else ' we are in the middle so make sure that both buttons are enabled
  577.         ' enable the 'back' button
  578.         cmdSlide(0).Enabled = True
  579.         ' enable the 'next' button
  580.         cmdSlide(1).Enabled = True
  581.     End Select
  582.     ' since only one slide uses this text box it can be set to empty to save a little memory
  583.     txtTipsAndTricks.Text = ""
  584.     ' make desired slide visible
  585.     Select Case SlideNumber
  586.     Case 1
  587.         Set oCurrentFrame = fraTheLook
  588.         oCurrentFrame.Visible = True
  589.         ' tell user how to set off an alarm!
  590.         sMessageText = "Simply click on a control to make it 'ring'"
  591.     Case 2
  592.         Set oCurrentFrame = fraProperties
  593.         oCurrentFrame.Visible = True
  594.         ' tell user what this slide is about
  595.         Dim sDoubleQuote As String * 1
  596.         sDoubleQuote = Chr$(34)
  597.         ' show cool quote
  598.         sMessageText = sDoubleQuote & "I think that programming is an art form." & sDoubleQuote & " - Amy Allsmyles, 1995."
  599.     Case 3
  600.         Set oCurrentFrame = fraTipsAndTricks
  601.         oCurrentFrame.Visible = True
  602.         With txtTipsAndTricks
  603.             .Text = "But I Don't Hear A Thing!" & vbCrLf & "The MhAlarm control uses your PC's sound card to produce its sounds as opposed to your PC's internal speaker.  If the control appears to shake but you never hear a ring then try configuring your sound board."
  604.             .Text = .Text & vbCrLf & vbCrLf & "Using Wave Files" & vbCrLf & "By setting the .WaveSource and .WaveName properties you can specify the .Wav file that the control uses to make its ring sound.  Set .WaveSource to 1 - System to choose .Wave files used by Windows.  To specify your own .Wav file set the .WaveSource property to 2 - FileName and set the .WaveName property to the path of the .Wav file."
  605.             .Text = .Text & vbCrLf & vbCrLf & "Continous Ring" & vbCrLf & "Setting the RingOn property to 1 will cause the control to ring once.  However, the control will ring continuously as long as the .RingOn property is 2.  See the frmMhAlarmPropertyTester.cmdTest_Click event."
  606.             .Text = .Text & vbCrLf & vbCrLf & "Using Custom Bitmaps" & vbCrLf & "To get the animated effect the control displays three bitmaps one after the other.  The three PictureX properties allow you to specify your own bitmaps to use.  In addition, the control masks the bitmaps to make the usual square bitmap background disappear.  To get the same effect with your bitmaps, you need to make a mask for each of the three PictureMaskX properties.  For more information on using masks please see the helpfile."
  607.         End With ' txtTipsAndTricks
  608.         ' give user a tip
  609.         sMessageText = "Best advice:  Know your tools, read the manual well!"
  610.         cmdSlide(0).SetFocus
  611.     End Select
  612.     ' make all frames invisible (except for the current frame)
  613.     Dim TempControl As Control
  614.     For Each TempControl In Me.Controls
  615.         If TypeOf TempControl Is Frame Then
  616.             With TempControl
  617.                 If .Tag = "slide frame" And .hWnd <> oCurrentFrame.hWnd Then .Visible = False
  618.             End With ' TempControl
  619.         End If
  620.     Next TempControl
  621.     ' show user message which goes with the selected slide
  622.     Call SetStatusLineText(sMessageText, vOverRide:=True)
  623. Exit Sub
  624. SetupFrames_Error:
  625. Select Case Err
  626. Case 5  ' setfocus while form still not loaded is ok to do
  627. End Select
  628. Resume Next
  629. End Sub
  630. Private Sub mnuMhAlarmContextMenu_About_Click()
  631.     Screen.MousePointer = vbHourglass
  632.     ' show about box of ocx control
  633.     Call MhIAlarmPropertyTester.AboutBox
  634.     Screen.MousePointer = vbDefault
  635. End Sub
  636. Private Sub mnuMhAlarmContextMenu_Close_Click()
  637.     ' if the user meant to exit then unload form
  638.     If MsgBox("Are you sure you want to exit?", vbQuestion + vbYesNo) = vbYes Then Unload Me
  639. End Sub
  640. Private Sub mnuMhAlarmContextMenu_Properties_Click()
  641.     ' allow the user to play with various properties of this control
  642.     ' show hourglass while form is loading
  643.     Screen.MousePointer = vbHourglass
  644.     ' tell form which control to work on
  645.     Set frmMhAlarmPropertyTester.OriginalAlarm = MhIAlarmPropertyTester
  646.     Load frmMhAlarmPropertyTester
  647.     Screen.MousePointer = vbDefault
  648.     frmMhAlarmPropertyTester.Show vbModal
  649. End Sub
  650. Private Sub tmrStatusLine_Timer()
  651.     ' tell status line that it is time to reset itself
  652.     Call SetStatusLineText("_timer_calling_")
  653. End Sub
  654.