Possible Duplicate:
C# Splash Screen Problem
I am new to c# , i am working on splash screen which runs when the software starts.. I have a function in splash Screen class which checks the database. I am using thread to call the function
sc = new splashScreen();
checkDLLThread = new Thread(new ThreadStart(sc.checkDLLS).BeginInvoke);
checkDLLThread.Start();
while (checkDLLThread.IsAlive)
{
Thread.Sleep(200);
}
Problem is UI is blocked until the thread is Alive. And in final it give me database connection status message.
Here is my code. I have used checkDLLThread.join() but it also doesnt work.
A splashscreen is simply an image to ‘amuse’ the user while your app is loading. Use the app_load method to execute code on startup:
Like so: (in app.xaml and app.xaml.cs)
Also, I think the BackGroundworker class is better for things like this, if you don’t want to bother the UI.