I used metro framework for create splash screen, but when i use .Abort()
function for thread then the splash screen is not working at all. But if i use .Suspend()
it's working but even after the main form load, splash screen is not disposing.
Here is the code,
public Login()
{
Thread t = new Thread(new ThreadStart(loading));
t.Start();
InitializeComponent();
for(int i = 0; i <= 1000; i++)
{
Thread.Sleep(10);
t.Abort();
}
}
void loading()
{
Splash frmsplash = new Splash();Application.Run(frmsplash);
}
here is splash screen code,
public partial class Splash : MetroFramework.Forms.MetroForm
{
public Splash()
{
InitializeComponent();
}
}