So basically what we do is, create a new Thread that will wrap a method called wait();
in the form_load, like this:
private void Form1_Load(object sender, EventArgs e)
{
ThreadStart ts = new ThreadStart(wait);
Thread t = new Thread(ts);
t.Start();
}
and then we create a method that will trigger the main form or application after a little wait, this gives the idea of "preloading" but without actually preloading anything.
public void wait()
{
Thread.Sleep(5000); //time to wait in milliseconds
MessageBox.Show("done loading"); // actions to take when the wait is done
}
and that's it.
Happy Coding!
No hay comentarios:
Publicar un comentario