We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

SuspendLayout / ResumeLayout WinForms Designer Support

Thread ID:

Created:

Updated:

Platform:

Replies:

22313 Dec 9,2004 09:44 AM Dec 15,2004 07:31 AM General Discussion 2
loading
Tags: General Discussion
Roy Muller
Asked On December 9, 2004 09:44 AM

I was wondering if anyone knows the trick to having the Windows Forms Designer know that a control supports SuspendLayout/ResumeLayout in its InitializeComponents() method. Is there some attribute to use, or an interface to implement? I apologize for this being slightly off-topic, but I can''t find this information anywhere. Thanks, -Roy

Roy Muller
Replied On December 10, 2004 07:29 AM

I''ll try this question in the Windows Forms Forum.

Daniel Jebaraj [Syncfusion]
Replied On December 15, 2004 07:31 AM

Hi Roy, Looking at the code (in Reflector) for the ControlCodeDomSerializer class, it appears that these calls get added in only when the control being serialized has child controls. If you wish to add them in for any other reason, you can derive from CodeDomSerializer to implement a CustomCodeDomSerialzer. This MSDN article has a sample and related information: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/custcodegen.asp
// code from ControlCodeDomSerializer 
  if (this.HasSitedNonReadonlyChildren((Control) value))
            {
                  this.SerializeSuspendResume(manager, (CodeStatementCollection) obj1, value, "SuspendLayout");
                  this.SerializeSuspendResume(manager, (CodeStatementCollection) obj1, value, "ResumeLayout");
            }
Best regards, Daniel

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;