I am creating a winform app that does a big data pull. It takes a while for the database to return the data.
I am already turning the mouse pointer into an hourglass, but I would like the form to remain animate while waiting for the database response so that the user can the app is busy, not frozen. My ulterior motive is wanting to learn how to use threads.
What I would like to accomplish is to have the status bar on the form say something like, "Retrieving data from the database..." and have the 3-periods alternate like I have seen in other apps, i.e., "" to "." to ".." to "...". As I understand threads, I would like the data pull or the alternating periods should be a separate thread so the periods are animated away while app waits for a database response.
Since the database query naturally ends, I would think that the query should be the thread so the thread could terminate naturally and the main app should be responsible for animating the periods while it waited for the query thread to terminate. The period animation would be in a while-loop that checked the status of the thread that was doing the datapull.
Do I understand threads correctly? Do I just need to study the syntax or am I missing something?
David S. Alexander
Kettley Publishing
20271 SW Birch Street, 2nd Floor
Newport Beach, CA 92660-1752