home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / objects.ba_ / objects.bin
Text File  |  1993-04-28  |  2KB  |  50 lines

  1. Option Explicit
  2. Global NextFormNum As Integer       ' These variables must be global so
  3. Global frmEnabledTimer As frmMain   ' all instances have access to them.
  4.  
  5. Sub DisableFrames ()
  6. Dim i As Integer, j As Integer
  7. Dim Frm As Form
  8.     For i = 0 To Forms.Count - 1
  9.         Set Frm = Forms(i)  ' Can now use frm as shorthand for Forms(i)
  10.  
  11.         If TypeOf Frm Is frmMain Then
  12.         ' Protect ourselves in case there are other forms (types).
  13.  
  14.             If frmEnabledTimer Is Nothing Or frmEnabledTimer Is Frm Then
  15.             ' Either there isn't a form with an enabled timer, or there is
  16.             ' and it is this instance, so enable option buttons and frame.
  17.                 For j = 0 To 2
  18.                     Frm!OptFlashTarget(j).Enabled = True
  19.                 Next
  20.                 Frm!fraX.Enabled = True
  21.         
  22.             Else
  23.             ' There's a form with a timer enabled and it isn't this one
  24.             ' so disable option buttons and frame.
  25.                 For j = 0 To 2
  26.                     Frm!OptFlashTarget(j).Enabled = False
  27.                 Next
  28.                 Frm!fraX.Enabled = False
  29.             End If
  30.         End If
  31.     Next
  32. End Sub
  33.  
  34. Sub Flash (Frm As Form)
  35. ' Notice that argument is declared As Form.
  36. ' This is required because Screen.ActiveForm
  37. ' can be passed to this procedure.
  38. Dim temp As Long, i As Integer
  39.  
  40. ' Flash form by swaping forecolors and backcolors twice.
  41.     For i = 1 To 2
  42.         temp = Frm.BackColor
  43.         Frm.BackColor = Frm!lstForms.ForeColor
  44.         Frm!lstForms.BackColor = Frm!lstForms.ForeColor
  45.         Frm!lstForms.ForeColor = temp
  46.         Frm.Refresh
  47.     Next
  48. End Sub
  49.  
  50.