Hide and then show changes to a form?

  • Thread starter Thread starter Brian Newman
  • Start date Start date
B

Brian Newman

In past languages (I'm thinking of FoxPro here and possibly VB 2.0 or
so), you could "freeze" the visual display of a form while you update
it in code, then "reveal" the updated form. This kept the display
from flashing or bogging down while it drew every individual thing one
at a time and made it look neat and clean to the user.

Is there a similar function in VB.NET, without actually hiding the
form?
 
Hi,

SuspendLayout and ResumeLayout

http://msdn.microsoft.com/library/d...indowsformscontrolclasssuspendlayouttopic.asp

Ken
----------------------------
In past languages (I'm thinking of FoxPro here and possibly VB 2.0 or
so), you could "freeze" the visual display of a form while you update
it in code, then "reveal" the updated form. This kept the display
from flashing or bogging down while it drew every individual thing one
at a time and made it look neat and clean to the user.

Is there a similar function in VB.NET, without actually hiding the
form?
 
Brian Newman said:
In past languages (I'm thinking of FoxPro here and possibly VB 2.0 or
so), you could "freeze" the visual display of a form while you update
it in code, then "reveal" the updated form. This kept the display
from flashing or bogging down while it drew every individual thing one
at a time and made it look neat and clean to the user.

On the one hand, you can prevent .NET's /layouting/ engine from working by
calling the form's 'SuspendLayout' and 'ResumeLayout' methods.

On the other hand, you can prevent /drawing/ of a specific window using
p/invoke:

Preventing controls from redrawing
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=disableredrawing>

Some controls, like listboxes and comboboxes provide 'BeginUpdate' and
'EndUpdate' methods to prevent the control from updating its UI while items
are added/removed/changed.
 
Thanks to all for the suggestions, though neither of those techniques
seems to be working in my particular situation. I can still see each
control being painted on, whether I put Suspend/ResumeLayout or
SendMessage False/True for the form or for the panels that hold the
text boxes. I'll keep fiddling with it.
 

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

Back
Top