Click to See Complete Forum and Search --> : Counting while a msgbox is active
shaminda
March 16th, 2001, 12:50 PM
I have two counters that runs using a timer. So according to the timer Interval the counter goes up. I print an error message(using MsgBox) when the first counter reaches say 100. But until I close the message the second count won't count. How do I increment the second counter when the message box is stile active?
robby bassic
March 16th, 2001, 12:58 PM
Try DoEvents.
If that doesn't work then display your message in a Label with a beep, or pop up your own form that you create (simulate the MsgBox).
shaminda
March 16th, 2001, 02:48 PM
No DoEvents did not work
shree
March 16th, 2001, 08:05 PM
use the timeGetTime() API function to get the time before and after MsgBox(). The difference between these two values will give you the time elapsed in milliseconds. You can divide this value by the time interval to get the count.
Clearcode
March 20th, 2001, 05:59 AM
The message box command suspends the thread calling it - exactly as would be the case if you loaded a modal form.
The timer will not be triggered, and the code after the messagebox will not be executed until the messagebox is closed.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
cksiow
March 20th, 2001, 11:48 PM
I think you need modeless dialog box
try
http://vblib.virtualave.net
there got a function ShowMessageBox & HideMessageBox in the vbGeneralControl class which might help.
Timothy
March 22nd, 2001, 01:13 AM
When you run the program in visual basic environment, msgbox stops the timer but when you run the exe file msgbox don't stop the timer unless the msgbox is inside the timer routine.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.