i have a windows application in visual studio 2008 framework 3.5, I need concurrent waiting window where a process is going on in a window and on that window another form appears with some moving image (animation) just like a .gif image.
I have 2 forms, on form2, on button click i perform a lengthy process, i want that my 'frmWait' appears on screen while the process on form2 is going on and disappears when it finished. When my 'frmWait' appears, then form 2 should not be accessible to user.
my code is here. Form 2
in SomeWork procedure there is a for loop i have wrote, but actually in program it is database commands that performs in sqlserver, when query executes on server, my main programs working is halt until server finishes working, afterward the program gains exectution pointer, meanwhile, software seems that is is hanged.
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
frmWait fw = new frmWait("Wait...",0);
fw.Show();
SomeWork();
fw.Close();
}
private void SomeWork()
{
for (int x = 0; x < 99999999; x++)
{ }
}
}
}