Articles in this section

How to reduce the flickering that occurs while loading the saved dock state in WinForms Docking Manager?

Dock state

The flickering can be reduced to great extent by locking the form's update, through the method called "LockWindowUpdate". This should be called before calling the method LoadDockState and should be released after the execution of the LoadDockState. Please refer the below code snippet which illustrates this:

C#

// Import the required assemblies for the LockWindowUpdate interop call
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
private static extern bool LockWindowUpdate(Int64 windowHandle);
LockWindowUpdate(this.Handle.ToInt64());
LockWindowUpdate(IntPtr.Zero);

 

VB

' Import the required assemblies for the LockWindowUpdate interop call
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
private static extern bool LockWindowUpdate(Int64 windowHandle);
LockWindowUpdate(this.Handle.ToInt64());
LockWindowUpdate(IntPtr.Zero);

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied