home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch15 / ctimer / testform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-06-22  |  2.7 KB  |  88 lines

  1. VERSION 5.00
  2. Begin VB.Form TestForm 
  3.    Caption         =   "CTimer Class Test Form"
  4.    ClientHeight    =   1890
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   1890
  10.    ScaleWidth      =   4680
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command1 
  13.       Caption         =   "Start Timing"
  14.       BeginProperty Font 
  15.          Name            =   "Verdana"
  16.          Size            =   9.75
  17.          Charset         =   0
  18.          Weight          =   400
  19.          Underline       =   0   'False
  20.          Italic          =   0   'False
  21.          Strikethrough   =   0   'False
  22.       EndProperty
  23.       Height          =   495
  24.       Left            =   120
  25.       TabIndex        =   2
  26.       Top             =   240
  27.       Width           =   1935
  28.    End
  29.    Begin VB.CommandButton Command2 
  30.       Caption         =   "Show Interval"
  31.       BeginProperty Font 
  32.          Name            =   "Verdana"
  33.          Size            =   9.75
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   495
  41.       Left            =   120
  42.       TabIndex        =   1
  43.       Top             =   1200
  44.       Width           =   1935
  45.    End
  46.    Begin VB.CommandButton Command3 
  47.       Caption         =   "E X I T"
  48.       BeginProperty Font 
  49.          Name            =   "Verdana"
  50.          Size            =   9.75
  51.          Charset         =   0
  52.          Weight          =   400
  53.          Underline       =   0   'False
  54.          Italic          =   0   'False
  55.          Strikethrough   =   0   'False
  56.       EndProperty
  57.       Height          =   495
  58.       Left            =   2640
  59.       TabIndex        =   0
  60.       Top             =   1200
  61.       Width           =   1935
  62.    End
  63. Attribute VB_Name = "TestForm"
  64. Attribute VB_GlobalNameSpace = False
  65. Attribute VB_Creatable = False
  66. Attribute VB_PredeclaredId = True
  67. Attribute VB_Exposed = False
  68. Dim TMR As New CTimer
  69. Private Sub Command1_Click()
  70.     If Command1.Caption = "Start Timing" Then
  71.         TMR.StartCounting
  72.         Command1.Caption = "Stop Timing"
  73.     Else
  74.         TMR.StopCounting
  75.         Command1.Caption = "Start Timing"
  76.     End If
  77. End Sub
  78. Private Sub Command2_Click()
  79.     ETime = TMR.ElapsedTime
  80.     MsgBox "I've been counting for " & vbCrLf & _
  81.         Hour(ETime) & " hours" & vbCrLf & _
  82.         Minute(ETime) & " minutes and " & vbCrLf & _
  83.         Second(ETime) & " seconds" & vbCrLf
  84. End Sub
  85. Private Sub Command3_Click()
  86.     End
  87. End Sub
  88.