home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / articles / vbdev / source / dwtim3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-22  |  3.8 KB  |  129 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   6330
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   3075
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   1
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   6735
  21.    Left            =   1035
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   6330
  24.    ScaleWidth      =   3075
  25.    Top             =   1140
  26.    Width           =   3195
  27.    Begin VB.TextBox Text1 
  28.       Appearance      =   0  'Flat
  29.       Height          =   315
  30.       Left            =   1980
  31.       TabIndex        =   3
  32.       Top             =   5940
  33.       Width           =   1035
  34.    End
  35.    Begin VB.CheckBox Check1 
  36.       Appearance      =   0  'Flat
  37.       BackColor       =   &H80000005&
  38.       Caption         =   "dwtimer10 Enabled"
  39.       ForeColor       =   &H80000008&
  40.       Height          =   255
  41.       Left            =   180
  42.       TabIndex        =   2
  43.       Top             =   5580
  44.       Width           =   2175
  45.    End
  46.    Begin VB.Timer Timer1 
  47.       Index           =   0
  48.       Interval        =   10
  49.       Left            =   1320
  50.       Top             =   180
  51.    End
  52.    Begin VBX.dwTimerCtl dwTimer1 
  53.       Index           =   0
  54.       Interval        =   300
  55.       Left            =   60
  56.       Top             =   180
  57.    End
  58.    Begin VB.Label Label3 
  59.       Appearance      =   0  'Flat
  60.       BackColor       =   &H80000005&
  61.       Caption         =   "dwTimer10 Interval"
  62.       ForeColor       =   &H80000008&
  63.       Height          =   195
  64.       Left            =   120
  65.       TabIndex        =   4
  66.       Top             =   6000
  67.       Width           =   1815
  68.    End
  69.    Begin VB.Label Label2 
  70.       Appearance      =   0  'Flat
  71.       BackColor       =   &H80000005&
  72.       ForeColor       =   &H80000008&
  73.       Height          =   375
  74.       Index           =   0
  75.       Left            =   1920
  76.       TabIndex        =   1
  77.       Top             =   180
  78.       Width           =   915
  79.    End
  80.    Begin VB.Label Label1 
  81.       Appearance      =   0  'Flat
  82.       BackColor       =   &H80000005&
  83.       ForeColor       =   &H80000008&
  84.       Height          =   315
  85.       Index           =   0
  86.       Left            =   180
  87.       TabIndex        =   0
  88.       Top             =   180
  89.       Width           =   1035
  90.    End
  91. Attribute VB_Name = "Form1"
  92. Attribute VB_Creatable = False
  93. Attribute VB_Exposed = False
  94. Option Explicit
  95. Private Sub Check1_Click()
  96.     If Check1.Value = 1 Then dwTimer1(10).Enabled = True Else dwTimer1(10).Enabled = False
  97. End Sub
  98. Private Sub dwTimer1_Timer(Index As Integer)
  99.     Dim y&
  100.     y& = Val(label1(Index).Caption)
  101.     label1(Index).Caption = Str$(y& + 1)
  102. End Sub
  103. Private Sub Form_Load()
  104.     Dim x%
  105.     For x% = 1 To 10
  106.         Load dwTimer1(x%)
  107.         Load label1(x%)
  108.         label1(x%).Top = label1(0).Top + x% * 400
  109.         label1(x%).Caption = "label " & x%
  110.         label1(x%).Visible = True
  111.     Next x%
  112.     For x% = 1 To 10
  113.         Load Timer1(x%)
  114.         Load label2(x%)
  115.         Timer1(x%).Interval = 400 * x%
  116.         label2(x%).Top = label2(0).Top + x% * 400
  117.         label2(x%).Caption = "label " & x%
  118.         label2(x%).Visible = True
  119.     Next x%
  120. End Sub
  121. Private Sub Text1_Change()
  122.     dwTimer1(10).Interval = Val(Text1.Text)
  123. End Sub
  124. Private Sub Timer1_Timer(Index As Integer)
  125.     Dim y&
  126.     y& = Val(label2(Index).Caption)
  127.     label2(Index).Caption = Str$(y& + 1)
  128. End Sub
  129.