In some "extreme" cases I use the Win32 "LockWindowUpdate()"...
(! You can Lock only one control at a time. Locking an second control will
Unlock the previous locked one)
public class TWinFct
{
[DllImport("user32")]
private static extern int LockWindowUpdate(IntPtr hwndLock);
public static int LockControlUpdate(Control AControl)
{
return LockWindowUpdate(AControl.Handle);
}
public static int UnLockControlUpdate()
{
return LockWindowUpdate(IntPtr.Zero);
}
}
usage :
{
//Lock Control update
TWinFct.LockControlUpdate(MyControl)
//.... do things
//Unlock Control update
TWinFct.UnLockControlUpdate()
}
Steph.
"schaf" <sc***@2wire.chwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
Hi NG!
I have a panel which acts as a container for different usercontrols.
Depending on the current state the corresponding usercontrol is
displayed. If I change the state, I remove the current usercontrol from
the panel and add the new one.
During initializing the new usercontrol the panel shows some textbox
component boarders of the removed usercontrol, which does not look very
nice. How can I freez the GUI or the panel and only call a repaint
after the initializing process ?
I tried with Suspend- and ResumeLayout, but this does not work.
Thanks and regards
Marcel