angus_young_acdc
asked on
Update Label On Another Thread?
Hey Experts,
I have a splash screen, which is just a form that creates a thread for itself (so that the people who use it don't have to). Anyway I am hoping to add a label to update with information, but as it's a completely different thread I can't see to find a way.
Anyway, how can I update a label on SplashForm from a method call in MainForm. It currently works similar to the following:
(In MainForm)
SplashForm splash = new SplashForm();
splash.StartSplash(); // Which contains a method to create a thread
// Do actions
splash.LoadingMessage = "MyMessage";
splash.CloseSplash();
I have a splash screen, which is just a form that creates a thread for itself (so that the people who use it don't have to). Anyway I am hoping to add a label to update with information, but as it's a completely different thread I can't see to find a way.
Anyway, how can I update a label on SplashForm from a method call in MainForm. It currently works similar to the following:
(In MainForm)
SplashForm splash = new SplashForm();
splash.StartSplash(); // Which contains a method to create a thread
// Do actions
splash.LoadingMessage = "MyMessage";
splash.CloseSplash();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://blogs.msdn.com/csharpfaq/archive/2004/03/17/91685.aspx
Updating the UI from a Secondary Thread
http://msdn.microsoft.com/en-us/magazine/cc188732.aspx
Perhaps you should take a look at this article: Updating the UI from a Secondary Thread
http://msdn.microsoft.com/en-us/magazine/cc188732.aspx
http://weblogs.asp.net/justin_rogers/articles/126345.aspx