StrataFrame Forum

How to avoid flicking on WinForm?

http://forum.strataframe.net/Topic26671.aspx

By dgsoft - 3/29/2010

Hi,

Maybe question not a special about strataframe framework, but maybe someone help..



How to prevent form Redraw? For example, I add programmatically docking panel and add control to this panel in runtime. During this process form blinking.

I had try to use Win32 LockWindowUpdate not helps..



Is there the way stop redraw MicroFour.StrataFrame.Application.StrataFrameApplication.MainForm and all whats located inside this form?



Any idea!

Thanks

Denis
By Greg McGuffey - 3/29/2010

Use the SuspendLayout() and ResumeLayout() methods of the form. I'd also use it for the panel itself. E.g.



//-- Code that adds controls in method of the form.

ThemedPanel myPanel = new ThemedPanel();

this.SuspendLayout();

myPanel.SuspendLayout();

//-- add controls....

myPanel.ResumeLayout();

this.ResumeLayout();