-
Hello!
I am using vb5. I want to have a command button to cancel a long process. If I place a timer control and look for the command button click, it never happens.
When the process starts, the screen freezes and only a listview is updated. But the buttons doesn't get focus. How do I do it?
Thanks,
------------------
ganraj.
-
Put a DoEvents statement in the loop.
------------------
Marty
-
Scatter a few "DoEvents" statements in your code to give Windows a chance to do other things while your program is running...if your process if a loop then just put "DoEvents" in once inside the loop. This will give the user chance to click the Cancel button.
Now make a public variable eg "Dim bCancel As Boolean" and when the Cancel button is pressed set this vairble to true.
Then make your process regularly check the contents of this variable and about if it becomes true. I personally would make this check after each "DoEvents" statement.
------------------
Matthew Ralston
E-Mail: [email protected]
ICQ:31422892
Web Sites:The Blue Link My Home Page (Not up at the moment!)
-
Hello Marty!
Thanks... It works...
------------------
ganraj.
-
Hello Mathew!
Thanks to you also...
------------------
ganraj.