Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping Processes

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Hi all,

Is it possible to have a button on a form which forces a stop on the process. My program uses the processor at 100% from start to end so I was just wondering whether its possible to stop it half way through?

Just like pressing Alt + Break, or is it Ctrl + Break.

Thanks for any help!

Mel
 
Hi,

You'll have to use 'do events'.

One solution is to have a boolean that is set to false when the program starts. Put a button on the form and when you click on the button the boolean is set to true. Then put in a line in each loop of your program:
do events : if [your boolean] then msgbox("I am waiting for you to allow me to continue."): [your boolean]=false

or you could also let the user choose to end the program:
if [your boolean] then if msgbox("End?",vbyesno)=vbyes then End else : [your boolean]=false

Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top