Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using threads to keep UI animated
Message
De
02/12/2004 21:33:12
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Using threads to keep UI animated
Divers
Thread ID:
00966599
Message ID:
00966599
Vues:
51
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform