I have a splash screen in my winforms application which occasionally throws exception Thread was being Aborted when I try to abort it, if I don't abort the thread, the splash screen doesn't go away, can someone help with a better way to get this done?
Here's my code:
public FrmMainForm()
{
Thread thread = new Thread(new ThreadStart(Loading));
thread.Start();
InitializeComponent();
for (int i = 0; i <= 500; i++)
Thread.Sleep(4);
try
{
thread.Abort();
}
catch (ThreadAbortException)
{
Thread.ResetAbort();
}
}
void Loading()
{
try
{
//FrmSplashScreen form = new FrmSplashScreen();
Application.Run(new FrmSplashScreen());
}
catch
{
};
}