C# .Net

Feb 23 2007 1:01 AM
Hi all, I am doing a C#.net project which I want to build some buttons, text boxes, labels... like controls as templates and it should be possible to change there BackColor like properties only by changing the base class of particular template. So, I have BaseButton Class which inherits System.Windows.Forms.button class and the ButtonTemplate1,ButtonTemplate2... each class inherits the BaseButton Class. I can put these ButtonTemplate1,ButtonTemplate2... controls in to a Form and want to change there BackColor property only by changing it in the BaseClass and referencing the newly created dll in the project. But it is not possible, due to the "Auto generated codes" in the InitializeComponent() in the Form, as it overrides the BaseClass properties by the button's local properties. If I comment these codes in the Form, it will re appear after loading the Form design view again. So, to avoid this I used a UserControl and inside the user control, I put a BaseButton and comment relevant Auto generated codes and use the User Control without loading the design view of the User Control. Is there a good way to do this? Can anybody help me on this? My email is [email protected]