|
-
March 3rd, 2001, 10:23 PM
#1
How to create a stopwatch?
I want to create a running 'stopwatch' for my game program. the 'stopwatch' time should be shown in a label box. It should be function like "microsoft Minesweeper Game" timer.
-
March 4th, 2001, 07:57 AM
#2
Re: How to create a stopwatch?
put a timer control on your form, set its interval to 1000(milliseconds) set its enabled to false.
Then
private Sub Command1_Click()
Timer1.Enabled = true
End Sub
private Sub Timer1_Timer()
static cnt as Integer
cnt = cnt + 1
Label1.Caption = cnt
End Sub
You cannot make the timer tick more rapidly than once per 55 ms.
-
March 4th, 2001, 08:49 AM
#3
Re: How to create a stopwatch?
how do i disable the stopwatch timer with the same command button?
-
March 4th, 2001, 09:23 AM
#4
Re: How to create a stopwatch?
private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|