Hi Barry Kwok,
Based on my understanding, what you want to do is to control the code generation during design time, right? If so, there is a Serializer associated with each component class. The Serializer, which controls the serialization of the component, is generally based on System.ComponentModel.Design.Serialization.CodeDomSerializer. To modify the serialization process, we can derive from this class and provide custom serialization process. And then we need to set the custom Serializer as the Serializer of the Component using the System.ComponentModel.Design.Serialization.DesignerSerializer attribute.
For more information, please check the following page:
http://msdn.microsoft.com/en-us/library/system.componentmodel.design.serialization.codedomserializer.aspx
I also found the following article, which may help.
Best regards.
Rong-Chun Zhang
Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs