Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using threads to keep UI animated
Message
From
02/12/2004 21:33:12
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Using threads to keep UI animated
Miscellaneous
Thread ID:
00966599
Message ID:
00966599
Views:
52
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
Next
Reply
Map
View

Click here to load this message in the networking platform