I need help getting my application to run in the background
Hi guys,
So I'm not exactly sure how to go about this but I am trying to get my application to run in the "background". My app uses a search button and when it is clicked it sends back results for the user. I still want that functionality to work while running in the background but I have not been able to figure it out.
If you have any further questions or I was not clear enough in my questioning, please feel free to ask, thank you.
Thanks for the help!
:)
Re: I need help getting my application to run in the background
The concept that you want to implement is Multi-Threading. In the .Net framework, there is a component called the BackgroundWorker which really helps simplifying Multi-Threading. Basically what it does is perform the task you're wanting to do in a separate thread.
To use the BackgroundWorker, you setup the task you're wanting to do in the DoWork event. To start the BackgroundWorker you call it's RunWorkerAsync Method, a lot of times this is done in a Button or in the Form's Load event. Then once all the work has been completed, the RunWorkerCompleted Event gets raised.
Re: I need help getting my application to run in the background
Awesome! that makes perfect sense. I''ll give this a try thank you very much.
Re: I need help getting my application to run in the background
No problem, if you run into any problems just post them here as multi-threading can get a little finicky.