Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label doesn't appear on form.show() 2

Status
Not open for further replies.

bluntbill

Programmer
Jun 7, 2006
57
PT
I have a form called main.

When something is processing, I show a new form, called waiting, so that the user knows he has to wait for the processing to end.

The waiting form has a label which contains the waiting text...

In the main form, the function has this code:

this.Enabled = false;
waiting frm_w = new waiting();
frm_w.Show();
//
// the code that does the processing
//
frm_w.Close();
this.Enabled = true;
this.Focus();

The problem is that the waiting form appears, but the label that has the text doesn't appear. the form shows a gray rectangle in the place where the label should be.

Any idea why this happens and how to solve it?

Thank you
 
Try this:

Code:
this.Enabled = false;
waiting frm_w = new waiting();
frm_w.Show();
Application.DoEvents();
// 
// the code that does the processing
//
frm_w.Close();
this.Enabled = true;
this.Focus();
 
thank you both for your replies.

Application.DoEvents();

this was all I needed to get it working.

Here's a star for you. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top