Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / April 2006

Tip: Looking for answers? Try searching our database.

How do i get a running stop watch in vb

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pallytruck - 28 Apr 2006 01:04 GMT
Please could you help me.
I just want to display a timer constantly running and being displayed in vb
say in a textbox.
I want to use it to action at certain points via various variables and
actions.
The timer function starts off the clock at the current time and if i stop
the clock i can minus finish time from start time but that would mean
stopping it every time just to display result i want it displayed so it would
be constantly running and updating like a typical countdown or countup. All i
want is a timer starting at 00:00 and keep running throughout at bottom of
screen and everything can just carry on running and referenfing to it
occasionally.

for example a program say where the msg says "You have 5 seconds to hit the
button"
it counts done from 5 or up from 0 in a box at bottom of screen until the
person presses it or fails if time runs out
thanks
john
Michael Bauer - 28 Apr 2006 05:45 GMT
Am Thu, 27 Apr 2006 17:04:02 -0700 schrieb pallytruck:

Here´s a sample for an API timer:
http://www.vboffice.net/sample.html?mnu=2&smp=4&cmd=showitem

Please scroll down and copy the code for the module "modTimer.bas". You can
then add an UserForm to your project with that textbox and an Ok and Cancel
button. The Form will need a public method named Timer, which will be called
by the timer.

You can launch that UserForm and start the timer with
    modTimer.EnableTimer 1000
That means the timer fires once per second. In the UserForm´s Timer method
update the box, call DoEvents and check if the User has pressed a button.
Additioinally count the events being fired. After 5 events or if a button
was pressed stop the timer.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 -- www.vbOffice.net --

> Please could you help me.
> I just want to display a timer constantly running and being displayed in vb
[quoted text clipped - 15 lines]
> thanks
> john
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.