Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2007, 02:25 AM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# Auto Generate Codes

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] :D

Lasith





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to auto generate date? okboy SQL Server 2000 3 December 12th, 2006 08:17 PM
Auto generate no mateenmohd Classic ASP Basics 3 June 11th, 2006 07:06 AM
Auto generate? nikryden BOOK: Beginning VB.NET Databases 2 December 19th, 2005 12:43 PM
How to create auto generate variables? yikchin JSP Basics 1 December 19th, 2005 07:27 AM
auto generate an number utarian Access 2 March 28th, 2005 02:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.