"Ron" wrote:
Hi,Hi Ron,
I have several windows forms in my project all which derive from a custom
form template. There is a lot of processing that goes on in the constructor
but I have kept the form_load event handler method free of any code.
My problem is that when I load the form it appears to draw incrementally
instead of just "snapping" up. I ideally would like to do all the rendering
of the form while it is hidden showing itself when the form has completely
finished rendering itself.
I have tried all sorts of trickery but I cant seem to prevent the form from
drawing itself before the users eyes which gives the application a sluggish
look, when it really isnt.
Thanks for any tips you might be able to offer.
Ron
I'm afraid you won't get the snappy user interface you may get with native
code. Event though you do all your creation in the constructor. A lot of
code won't actually run until the controls are actually created (assigned
with window handle etc). You are better off putting the loading code in the
load event rather than the constructor because of this.
There are things you can do to improve user experience. Especially for the
application startup. Use a splash screen if the loading takes a long time.
Hide complex usercontrols with a panel until everything is loaded. Use
DoubleBuffered. Cache data needed by the controls. Use asyncronous loading
of data.
--
Happy Coding!
Morten Wennevik [C# MVP]