471,349 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

RE: Form rendering issue

"Ron" wrote:

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.

Hi 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]

Sep 12 '08 #1
0 1118

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mark Hannon | last post: by
6 posts views Thread by Vaclav Jedlicka | last post: by
4 posts views Thread by Nacho Nachev | last post: by
17 posts views Thread by Jim Little | last post: by
19 posts views Thread by Coward 9 | last post: by
3 posts views Thread by SAL | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.