|
-
August 1st, 2000, 03:35 PM
#1
Simple timer problem
I want to start a timer when a command button is pressed on one form and
i want to stop timing when a command button is pressed on another form. How can
this be done. How does the other form know there is a timer running?
-
August 1st, 2000, 08:30 PM
#2
Re: Simple timer problem
On First Form
private Sub Command1_Click()
'Turn timer on
Timer1.Enabled = true
End Sub
On Second Form
private Sub Command2_Click()
If Form1.Timer1.Enabled = true then
'Timer is running
Form1.Timer1.Enabled = false
else
'Timer is not running
End If
End Sub
Alternate for Second Form
(Turn it off without checking it)
private Sub Command3_Click()
'Ensure timer is turned off
Form1.Timer1.Enabled = false
End Sub
-
August 2nd, 2000, 04:27 AM
#3
Re: Simple timer problem
Thanks. That works, but i heard it was bad programming practice to do it that way although i can't see a way round it!
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
|