Refresh on form startup

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

My form startup implements some logic that takes a little while, but my form
isn't showing fully until it has all finished. I write progress messages to
a label and also update a progressbar, and even with Refresh() calls only a
"skeleton" of the form is displayed until all logic is complete.

How can I do this properly ?
 
Hmm no it didn't really help. My code is called from the form's constructor,
after the call to InitializeComponent. Is this the correct place ?
 
Oh hang on though, the combination of both :

this.Show();
Application.DoEvents();

from the form's constructor DOES work. Thanks for the input.
 
JezB said:
Oh hang on though, the combination of both :

this.Show();
Application.DoEvents();

from the form's constructor DOES work. Thanks for the input.

Typically forms are not shown when they are initialized. They are shown by
either calling their 'Show' or 'ShowDialog' methods from outside the form.
The "skeleton drawing" problem seems to occur on some systems only.
 
Useful to know - thanks.

Herfried K. Wagner said:
Typically forms are not shown when they are initialized. They are shown
by either calling their 'Show' or 'ShowDialog' methods from outside the
form. The "skeleton drawing" problem seems to occur on some systems only.
 
Back
Top