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 / dwtim4.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-22  |  1.8 KB  |  63 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Timer Example 2"
  6.    ClientHeight    =   6330
  7.    ClientLeft      =   1110
  8.    ClientTop       =   1485
  9.    ClientWidth     =   3315
  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            =   1050
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   6330
  24.    ScaleWidth      =   3315
  25.    Top             =   1140
  26.    Width           =   3435
  27.    Begin VBX.dwTimerCtl Timer1 
  28.       Index           =   0
  29.       Interval        =   100
  30.       Left            =   120
  31.       Top             =   180
  32.    End
  33.    Begin VB.Label Label1 
  34.       Appearance      =   0  'Flat
  35.       BackColor       =   &H80000005&
  36.       ForeColor       =   &H80000008&
  37.       Height          =   315
  38.       Index           =   0
  39.       Left            =   660
  40.       TabIndex        =   0
  41.       Top             =   180
  42.       Width           =   2055
  43.    End
  44. Attribute VB_Name = "Form1"
  45. Attribute VB_Creatable = False
  46. Attribute VB_Exposed = False
  47. Option Explicit
  48. Private Sub Form_Load()
  49.     Dim x%
  50.     For x% = 1 To 10
  51.         Load Timer1(x%)
  52.         Load label1(x%)
  53.         label1(x%).Caption = "Not triggered"
  54.         label1(x%).Top = label1(0).Top + x% * 400
  55.         label1(x%).Visible = True
  56.     Next x%
  57. End Sub
  58. Private Sub Timer1_Timer(Index As Integer)
  59.     Dim y&
  60.     y& = Val(label1(Index).Caption)
  61.     label1(Index).Caption = Str$(y& + 1)
  62. End Sub
  63.