Oct 2nd, 2005, 10:22 PM
#1
Thread Starter
Lively Member
[RESOLVED] Setting a timer for ActiveX User control button to calculate pulse
Hi,
Does anyone know how to program a timer set to 0-500ms that will start counting when a button is pressed down, therefore executing the code for that button. After 500miliseconds the button will switch off and the timer would reset again and be ready for the next button to be pressed. If the timer has already started by pressing one button and has not finished to 500ms and another button is pressed, would like it to interrupt the timer and reset it again.
If anyone could help me, would be much appreciated.
Oct 3rd, 2005, 10:15 AM
#2
Re: Setting a timer for ActiveX User control button to calculate pulse
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Oct 4th, 2005, 10:08 PM
#3
Thread Starter
Lively Member
Re: Setting a timer for ActiveX User control button to calculate pulse
Hi Dave,
With the code you created, how do i display the timer's time on a form?
And I tried setting it up as well, but got a compile error with the following line:
VB Code:
Private WithEvents m_Timer As CountDownTimer
Maybe Im setting it up wrong, please advise..
thanks alot
Oct 5th, 2005, 08:33 AM
#4
Re: Setting a timer for ActiveX User control button to calculate pulse
It won't show the time as it's counting down. It just raises friendly Events.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Oct 5th, 2005, 08:34 AM
#5
Re: Setting a timer for ActiveX User control button to calculate pulse
The code I posted - it needs to be in a Class module.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Oct 6th, 2005, 09:49 PM
#6
Thread Starter
Lively Member
Re: Setting a timer for ActiveX User control button to calculate pulse
Originally Posted by
Dave Sell
The code I posted - it needs to be in a Class module.
Yup have put it in a class module same error.
What do you put on the form? Is it 2 buttons and a timer?
Oct 6th, 2005, 11:14 PM
#7
Re: Setting a timer for ActiveX User control button to calculate pulse
2 Buttons, named:
- cmdIncrement
- cmdIncrement10
The top of the form should have:
VB Code:
Option Explicit
'
Private WithEvents m_Timer As CountDownTimer
'
There is ni timer on the form.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Oct 11th, 2005, 10:27 PM
#8
Thread Starter
Lively Member
Re: Setting a timer for User control button to calculate pulse
Hey Dave,
Have setup a form that has your code with your instructions and it still has the same error. Have attached it for you to have a look
Attached Files
Oct 11th, 2005, 10:47 PM
#9
Re: Setting a timer for User control button to calculate pulse
Originally Posted by
potatocake
Hey Dave,
Have setup a form that has your code with your instructions and it still has the same error. Have attached it for you to have a look
Ya you need to name the class module, CountDownTimer
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Oct 12th, 2005, 10:59 PM
#10
Thread Starter
Lively Member
Re: Setting a timer for ActiveX User control button to calculate pulse
Opps sorry,
Have named the Class module as that now thanks.
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