|
-
Jan 10th, 2000, 11:21 PM
#1
Thread Starter
Member
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.
-
Jan 10th, 2000, 11:29 PM
#2
Put a DoEvents statement in the loop.
------------------
Marty
-
Jan 10th, 2000, 11:30 PM
#3
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!)
-
Jan 10th, 2000, 11:32 PM
#4
Thread Starter
Member
Hello Marty!
Thanks... It works...
------------------
ganraj.
-
Jan 10th, 2000, 11:35 PM
#5
Thread Starter
Member
Hello Mathew!
Thanks to you also...
------------------
ganraj.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|