473,465 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Customized components

I'd like to create a customized button- so I've written something like this

public class TestButton : Button

{

public TestButton() : base()

{

this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(100)) ,
((System.Byte)(114)), ((System.Byte)(138)));

this.FlatStyle = System.Windows.Forms.FlatStyle.Flat;

this.ForeColor = System.Drawing.Color.White;

this.Size = new System.Drawing.Size(96, 23);

this.TabIndex = 0;

}

}

I have compiled it into separate .dll because I want to be able t change
look & feel of buttons in client application without recompiling it (only by
replacing the .dll)

But now when I drag & drop my new button from the toolbox onto my form the
environment generates following code in the InicializeComponents() method:

..

this.TestButton2 = new TestButton();

this.TestButton2.BackColor =
System.Drawing.Color.FromArgb(((System.Byte)(100)) , ((System.Byte)(114)),
((System.Byte)(138)));

this.TestButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;

this.TestButton2.ForeColor = System.Drawing.Color.White;

this.TestButton2.Location = new System.Drawing.Point(72, 72);

this.TestButton2.Name = "sputnikButton2";

this.TestButton2.Size = new System.Drawing.Size(96, 23);

this.TestButton2.TabIndex = 0;

this.TestButton2.Text = "sputnikButton2";

..

so it duplicates the code from TestButton constructor. Now when I change for
example BackColor property in my TestButton and replace it's .dll in the
client application it will not take effect because the settings in the
constructor are overridden by code generated by VS environment.

How can I fix it???

Thanks in advance for any help!


Nov 15 '05 #1
0 916

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Scott | last post by:
Hi Everyone, Does anyone know if it's possible to allow an end user of an Access DB to personalize the layout of their own reports. What we would like to do is allow them to select the...
3
by: James | last post by:
Does anyone know if it is possible, in C#, to use a customized window frame? For example, programs like Winamp and AdAware do not use the standard box window frame, but a customized design. ...
1
by: Jean Bredeche | last post by:
Hi: I am trying to create customized confirmation/error/etc dialogs in my application. Up to now we've been using MessageBox.Show and passing it the various necessary flags (buttons, icons,...
0
by: Chris | last post by:
To centralize much of the database connectivity and variable declarations, I decided it would make sense to create my own class that inherits from the page class and derive each of my form classes...
0
by: segal.aviad | last post by:
Hi, I'm trying to create a customized setup project for my application. I want to write a setup project which will install several merge modules (- this I know how to do). Before running the...
5
by: RedHair | last post by:
I have a ASP.NET 2.0 web page which inherits a customized base page class and have a master page, their relation is as below Customized base page class --> web page --> master page How to...
7
by: SteveT | last post by:
I would like to create a customized DataGridViewColumn called DataGridViewCheckedListBoxColumn. I'd like the ability to multi-select items in the list. Does anyone know of an example of how this...
6
by: Victor | last post by:
Hi. all I have a customize web control. I have three simple properties and customized render class. then I add this control into my datalist like <asp:DataList ID="datalist" runat="server"...
25
by: Licheng Fang | last post by:
I mean, all the class instances that equal to each other should be reduced into only one instance, which means for instances of this class there's no difference between a is b and a==b. Thank...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.