I need the progress bar running while submit button is clicked and to freeze the screen for some 5 seconds but the code in the submit button should do the work in parallel.
I have created a wait form but I have called the wait form once the connection is closed so that progress bar is taking time to appear and I can select the other options in the screen which is shouldn't.
private void cmdselect_click(System.object _sender System.EventArgs e1)
{
using (frmwait frm=new frmwait(savedata)) // and I have called wait form here
{
frm.Showdialog(this)
}
}
// Savedata method
void Savedata()
{
for(int i=1;i<=500;i++)
{
Thread.Sleep(10);
}
}
Progress bar is not starting immediately once the button click is fired.