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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SuspendLayout / ResumeLayout WinForms Designer Support

Thread ID:





22313 Dec 9,2004 02:44 PM UTC Dec 15,2004 12:31 PM UTC General Discussion 2
Tags: General Discussion
Roy Muller
Asked On December 9, 2004 02:44 PM UTC

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 12:29 PM UTC

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

Daniel Jebaraj [Syncfusion]
Replied On December 15, 2004 12:31 PM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon