C
Cub71
I have a small app with a mainForm taking some info from comboboxes
and textboxes. These data are sendt with HttpWebRequest.
What I now have problems with is to show a "Please Wait" message while
it is sending. I have tried several approaches to this but none of
these work. It seems like the code is so eager with sending the data
that it forgets to paint the new message. :-|
private void menuItemSend_Click(object sender, EventArgs e)
{
String message = textBoxFreeText.Text;
PleaseWaitForm pwf = new PleaseWaitForm(message);
pwf.ShowDialog();
}
In the PleaseWaitForm I have this:
private void PleaseWaitForm_Load(object sender, EventArgs e)
{
ThreadStart starter = new ThreadStart(this.SendData);
Thread t = new Thread(starter);
t.Start();
this.Close();
}
private void SendData()
{
if (SendData(message))
{
this.Close();
MessageSentForm msf = new MessageSentForm();
msf.ShowDialog();
}
}
SendData is executed and working fine and I get the MessageSentForm().
But I never see the PleaseWaitForm.
Any ideas?
and textboxes. These data are sendt with HttpWebRequest.
What I now have problems with is to show a "Please Wait" message while
it is sending. I have tried several approaches to this but none of
these work. It seems like the code is so eager with sending the data
that it forgets to paint the new message. :-|
private void menuItemSend_Click(object sender, EventArgs e)
{
String message = textBoxFreeText.Text;
PleaseWaitForm pwf = new PleaseWaitForm(message);
pwf.ShowDialog();
}
In the PleaseWaitForm I have this:
private void PleaseWaitForm_Load(object sender, EventArgs e)
{
ThreadStart starter = new ThreadStart(this.SendData);
Thread t = new Thread(starter);
t.Start();
this.Close();
}
private void SendData()
{
if (SendData(message))
{
this.Close();
MessageSentForm msf = new MessageSentForm();
msf.ShowDialog();
}
}
SendData is executed and working fine and I get the MessageSentForm().
But I never see the PleaseWaitForm.
Any ideas?