Speeding form draw time?

J

John

I have a winform that is shown as a dialog that unfortunately has to
contain a very large amount of controls, nested controls, etc. The
result is that there is a fairly noticeable draw sequence when the form
is shown.

When I was doing some of my own drawing with a custom control, I could
double buffer the control so that things were drawn smoothly (or
appeared as such), I tried to use the new DoubleBuffered = true property
on the form but that had no effect. Is there any way to get the entire
form to paint itself in buffer before it attempts to display the form to
the user? I would be fine with a quick delay with an instant window, as
opposed to seeing it kind of roll in.

Any suggestions are appreciated.

Regards

John Parrish
 
J

Jared

For some controls I disable enable and try to do data manipulation of
controls before form is visible.

Also shouldn't be as bad when running from EXE.
 
G

Guest

just as a thought the controls you are using, do they offer some sort of
suspendlayout, or beginedit() endedit() functionality - we see a lot of that
in 3rd party controls. also if you are calling Refresh() then Invalidate()
might be a better call if you are a getting frequent updates.
 
J

John Parrish

In my case, we are using mostly Winform 2.0 controls that ship with CLR
2. I am doing Zero with the controls when the form minus 1 thing.. which
I suspect may be causing my issue.. I have a routine to loop across the
controls collection and disable all of the controls except 2 buttons.

I guess I can look into setting them all disabled to start.. or
suspendlayout / resumelayout during that disabling period.

I will report back with what happens. Thanks for the suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top