home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l405 / 1.ddi / FRMMAIN.FR_ / FRMMAIN.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  4.9 KB  |  162 lines

  1. VERSION 2.00
  2. Begin Form frmMain 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "frmMain"
  5.    ClipControls    =   0   'False
  6.    Height          =   3165
  7.    Left            =   915
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2760
  10.    ScaleWidth      =   4305
  11.    Top             =   1125
  12.    Width           =   4425
  13.    Begin CommandButton cmdExit 
  14.       Caption         =   "E&xit"
  15.       Height          =   375
  16.       Left            =   2160
  17.       TabIndex        =   7
  18.       Top             =   1080
  19.       Width           =   2055
  20.    End
  21.    Begin Frame fraX 
  22.       Caption         =   "Timer"
  23.       Height          =   1095
  24.       Left            =   2160
  25.       TabIndex        =   3
  26.       Top             =   1560
  27.       Width           =   2055
  28.       Begin Timer timFlash 
  29.          Enabled         =   0   'False
  30.          Interval        =   500
  31.          Left            =   1440
  32.          Top             =   240
  33.       End
  34.       Begin OptionButton OptFlashTarget 
  35.          Caption         =   "Flash &ActiveForm"
  36.          Height          =   255
  37.          Index           =   2
  38.          Left            =   120
  39.          TabIndex        =   6
  40.          Top             =   720
  41.          Width           =   1815
  42.       End
  43.       Begin OptionButton OptFlashTarget 
  44.          Caption         =   "Flash &Me"
  45.          Height          =   255
  46.          Index           =   1
  47.          Left            =   120
  48.          TabIndex        =   5
  49.          Top             =   480
  50.          Width           =   1215
  51.       End
  52.       Begin OptionButton OptFlashTarget 
  53.          Caption         =   "&Disabled"
  54.          Height          =   255
  55.          Index           =   0
  56.          Left            =   120
  57.          TabIndex        =   4
  58.          Top             =   240
  59.          Value           =   -1  'True
  60.          Width           =   1215
  61.       End
  62.    End
  63.    Begin CommandButton cmdClose 
  64.       Cancel          =   -1  'True
  65.       Caption         =   "&Close Me"
  66.       Height          =   375
  67.       Left            =   2160
  68.       TabIndex        =   2
  69.       Top             =   600
  70.       Width           =   2055
  71.    End
  72.    Begin CommandButton cmdNextInstance 
  73.       Caption         =   "&New Instance"
  74.       Default         =   -1  'True
  75.       Height          =   375
  76.       Left            =   2160
  77.       TabIndex        =   1
  78.       Top             =   120
  79.       Width           =   2055
  80.    End
  81.    Begin ListBox lstForms 
  82.       Height          =   2565
  83.       Left            =   120
  84.       TabIndex        =   0
  85.       Top             =   120
  86.       Width           =   1935
  87.    End
  88. Option Explicit
  89. Sub cmdClose_Click ()
  90.     ' Unload this instance
  91.     Unload Me
  92.     ' If this instance happens to be the original frmMain,
  93.     ' must set the implicity declared frmMain variable to Nothing
  94.     ' to release the resources associated with the variable.
  95.     If Me Is frmMain Then
  96.         Set frmMain = Nothing
  97.     End If
  98. End Sub
  99. Sub cmdExit_Click ()
  100.     End
  101. End Sub
  102. Sub cmdNextInstance_Click ()
  103. Dim NextInstance As New frmMain ' Form variable
  104.     NextFormNum = NextFormNum + 1
  105.     ' Because form variable was declared with New,
  106.     ' a new instance of frmMain is created as soon
  107.     ' as one of its properties, methods, or controls
  108.     ' is referenced.  This happens in the next line.
  109.     NextInstance.Caption = "Instance # " & NextFormNum
  110.     NextInstance.Left = Left + (Width \ 10)
  111.     NextInstance.Top = Top + (Height \ 10)
  112.     NextInstance.Show
  113.     ' Because the form variable is local to this procedure
  114.     ' (and not static) it disappears when the procedure ends.
  115.     ' Outside this procedure, the only way to regain a reference
  116.     ' to the new instance is through the Forms collection.
  117. End Sub
  118. Sub Form_Activate ()
  119. Dim i As Integer
  120.     ' Refill list (in case an instance was added or removed)
  121.     lstForms.Clear
  122.     For i = 0 To Forms.Count - 1
  123.         lstForms.AddItem Forms(i).Caption
  124.     Next
  125. End Sub
  126. Sub Form_Load ()
  127.     DisableFrames
  128. End Sub
  129. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  130.     If frmEnabledTimer Is Me Then Set frmEnabledTimer = Nothing
  131.     DisableFrames
  132. End Sub
  133. Sub lstForms_DblClick ()
  134. Dim i As Integer
  135.     ' Loop through Forms collection looking for
  136.     ' Form with same caption as the entry that
  137.     ' was double-clicked, then activate that form.
  138.     For i = 0 To Forms.Count
  139.         If Forms(i).Caption = lstForms.Text Then
  140.             Forms(i).SetFocus
  141.             Exit For
  142.         End If
  143.     Next
  144. End Sub
  145. Sub OptFlashTarget_Click (Index As Integer)
  146.     If Index = 0 Then
  147.         Set frmEnabledTimer = Nothing
  148.         timFlash.Enabled = False
  149.     Else
  150.         Set frmEnabledTimer = Me
  151.         timFlash.Enabled = True
  152.     End If
  153.     DisableFrames
  154. End Sub
  155. Sub timFlash_Timer ()
  156.     If OptFlashTarget(1).Value Then
  157.         Flash Me
  158.     Else
  159.         Flash Screen.ActiveForm
  160.     End If
  161. End Sub
  162.