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