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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start Stop Search 1

Status
Not open for further replies.

deulyd

Programmer
Oct 17, 2001
106
CA
Hi,

I have a VB6 application that has a "Search" button. The function behind the Search button may be heavy and long.

So I'd like to have a "Stop Search" button that my end user would be able to use to stop the "Search" Code.

And I dont have a clue on how to do that

Thanks

Daniel
 
What kind of search are you doing? Is is something asynchronous to your program? Is it something that your program is doing that could be interrupted?

In general, you could just have the stop button set a flag variable that your search function checks to see if it should keep going. Make sure your search function contains at least one "DoEvents" statement so the press of the stop button is detected and it's event handler is run.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Ah thank you very much tsdragon its exactly what I was looking for! The DoEvents ! :D

Daniel

 
Don't go overboard with putting "DoEvents" in your code. I understand that they can incur a lot of overhead. Judicious use should be OK.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Check out thread222-1047259

Alan

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top