Administrator
posted
1368 posts
since
Sep 10, 2003
from
|
|
Re: SuspendLayout C# Forms
|
|
|
|
|
|
|
|
|
|
|
I noticed this.SuspendLayout(); and this.ResumeLayout(false); generated by VS.NET automatically for me, maybe you could have a look into these methods.
|
|
|
|
|
|
Administrator
posted
1368 posts
since
Sep 10, 2003
from
|
|
Re: SuspendLayout C# Forms
|
|
|
|
|
|
|
|
|
|
|
Thanks for the reply, but if you look at the title of the original post or the text, I allready tried these methods and they had no beneficial effect.
|
|
|
|
|
|
John JC
posted
1 posts
since
Apr 30, 2006
from
|
|
Re: SuspendLayout C# Forms
|
|
|
|
|
|
|
|
|
|
|
try control.BeginUpdate() and control.EndUpdate()
|
|
|
|
|
|
Alan C Balkany
posted
11 posts
since
Sep 12, 2007
from
Earth
|
|
Re: SuspendLayout C# Forms
|
|
|
|
|
|
|
|
|
|
(I just posted this to another thread, but it appears to be an answer to your question, so I'm reposting it here. Hope it helps...)
================================
You can try SuspendLayout () before initializing your form and ResumeLayout () after initialization. Sometimes this doesn't work. When it doesn't, you can try using the Win32 functions:
Outside of your method:
using Microsoft.Win32; using System.Runtime.InteropServices;
[DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam); private const int WM_SETREDRAW = 11;
Before drawing:
SendMessage(ObjectControlPanel.Handle, WM_SETREDRAW, false, 0);
After drawing:
SendMessage(ObjectControlPanel.Handle, WM_SETREDRAW, true, 0);
You may then need to call Refresh ().
|
|
|
|
|
|
Michael Arrington
posted
1 posts
since
May 15, 2007
from
|
|
Re: SuspendLayout C# Forms
|
|
|
|
|
|
|
|
|
|
|
Thanks for the tip. That is VERY useful!!! It's now part of my library and it works very well.
|
|
|
|
|
|