On Jun 01, 2006, at 6:30 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

Thanks for the information.

There is one other question I should have asked ... because i knew it was coming.

While I am in the loop i want to see if someone has clicked a 'quit' pushbutton. I have tried setting the focus on the button removing the focus from the window and the only thing that happens is the timer stops. (that is probably because the timer starts running when the window is opened.) How do i get a program to keep an eye on the push button while running the timer <sheepish grin>

Sincerely,

While the loop you posted is running NOTHING else is going to happen. Certainly not a person pushing a button.
This sort of thing can make the UI unresponsive.

So the person can click things all they want and nothing will happen until the loop finishes.

IF you want a countdown timer that can run and still leave the UI responsive you need a different approach.

If you set the timer so it goes off once per second and there's a countdown NOT stored in the timer then it's a little easier.

Add a property to the window this timer is on
Call it countDown and make it an integer

Then make your timer properties mode Multiple and period 1000
In the timers action do

   dim xs as string

' if the countdown is at 0 then it has expired and we should do whatever is appropriate
   if countDown = 0 then
        me.mode = 0
   else
      xs=cstr(countDown)
      countdown = countdown - 1
      statictext1.text=xs
   end if

Then, in the button that should cancel the count down you can put (assuming the timer is named Timer1)

        timer1.mode = 0

and that will disable it


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to