Groups | Blog | Home
all groups > vb.net controls > february 2004 >

vb.net controls : Hide Form Updating


Jim Chapman
2/9/2004 10:39:19 AM
I have a routine that adds and removes buttons and controls to a form. I
don't like the way they flicker on and off the screen.

The TreeView control has a method, BeginUpdate, which disables any redrawing
of the tree view.

Is there a similar method for forms?

Thanks

Michael Dobler
2/10/2004 1:02:14 AM
try me.SuspendLayout and me.ResumeLayout.

this suppresses any layout events between these two calls.

Mike

"Jim Chapman" <CroutonJim@hotmail.com> schrieb im Newsbeitrag
news:eNRvFty7DHA.632@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

hirf-spam-me-here NO[at]SPAM gmx.at
2/10/2004 7:40:52 PM
* "Michael Dobler" <m.dobler@swissonline.ch> scripsit:
[quoted text, click to view]

Notice that this will only prevent .NET's layout logic (anchoring,
docking) from doing its work.

--
Herfried K. Wagner [MVP]
msnnews.msn.com
2/20/2004 12:46:49 PM
you could also use the API call to LockWindowUpdate... code example below:
-----------------------------------------
Declare Function LockWindowUpdate Lib "user32" (ByVal hWnd As Long) As Long

Public Sub LockWindow(ByVal hWnd As Long)
LockWindowUpdate(hWnd)
End Sub

Public Sub UnlockWindow()
LockWindowUpdate(0)
End Sub

-----------------------------------------
regards,
Paul.


[quoted text, click to view]

AddThis Social Bookmark Button