Click to See Complete Forum and Search --> : Problem with timer control


zafar_bhatti
April 25th, 2001, 06:09 PM
I am using timer control in my application. The problem is that it behaves different when I run the application from the VB environment and when I run exe file.

In vb environment, if there is a message box displayed, the timer event does not happen until you respond to that message box. (Thats what I want)

But when i create exe and run it, the timer event is fired even there is a message box displayed (which I dont want)

Any help will be appreciated.

Thanks,
Zafar

cksiow
April 26th, 2001, 12:15 AM
I think to solve this problem, what u need to do is to declare a public variable,

dim x as long

set the variable to some value, before trigger the message box and in the timer event, check the variable before executing any code, like this


x = 1
msgbox
x = 0

in timer event function

if x <> 1 then
do something...
end if

so, timer will be trigger but code wouldn't be executed cause the variable x become 1 before the msgbox is triggered.

HTH

cksiow
http://vblib.virtualave.net - share our codes