Hey guru's 
I want to show a busy dialog (Just a windows form called Busy.cs with some label text and a .gif animation) while my main form is busy processing data from a MySQL database.
Current code I use (don't laugh
)
Currently it shows the busy dialog for a split second, which obviously tells me something is way wrong. As I can actually notice the main form is still unresponsive for a second or so after the busy dialog disappeared. I've looked at http://www.codeproject.com/KB/threads/winformsthreading.aspx for examples, but they mainly just send text through, I failed miserably with forms. I'm also a total C# noob and teaching myself
So any help / tips are greatly appreciated. Thanks lads
I want to show a busy dialog (Just a windows form called Busy.cs with some label text and a .gif animation) while my main form is busy processing data from a MySQL database.
Current code I use (don't laugh
Code:
private void main_Load(object sender, EventArgs e)
{
Thread ShowBusy = new Thread(new ThreadStart(ShowBusyThread));
ShowBusy.Start();
//bunch of processing to generate datagrids etc
//I mostly use classes to handle these
}
....
private void ShowBusyThread()
{
Busy Busydialog = new Busy();
Busydialog.Show();
Thread.Sleep(2000);
}
Currently it shows the busy dialog for a split second, which obviously tells me something is way wrong. As I can actually notice the main form is still unresponsive for a second or so after the busy dialog disappeared. I've looked at http://www.codeproject.com/KB/threads/winformsthreading.aspx for examples, but they mainly just send text through, I failed miserably with forms. I'm also a total C# noob and teaching myself