473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Visual inheritance

Hi,
i have a base control MyButton inherit from System.Windows.Forms.Button
and i want to use it in all my application, this control set some properties
like Font, FlatStyle etc from a configuration file. I put this control in a
control library, then create a driver (test) project. In test project i add
a new form, and then from Toolbox "My user controls" a drag MyButton over
the new form. It works all perfectly.
But if i change a property of MyButtun (base class) (ex. ForeColor or
BackColor or Font), etc... from my configuration file, the childButton
(inherit from MyButton) doesn't change.
It is due to "Windows Form Designer" that in InitializeComponent, when i
drag the chil control over the form, add some code and set properties.
Is there any solotion for this problem?
How implement visual inheritance corretly?

Thanks in advance,
sorry for my english.

epederiva
Nov 15 '05 #1
1 1083
Hi,

You should close and re-open the form being designed to reflect the changes.
If you make changes to the code of MyButton (base class), you should close
the form being designed, rebuild the project it is contained in, and then
re-open the form in the designer.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"epederiva" <NO*************@NOSPAM.it> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
i have a base control MyButton inherit from System.Windows.Forms.Button and i want to use it in all my application, this control set some properties like Font, FlatStyle etc from a configuration file. I put this control in a control library, then create a driver (test) project. In test project i add a new form, and then from Toolbox "My user controls" a drag MyButton over
the new form. It works all perfectly.
But if i change a property of MyButtun (base class) (ex. ForeColor or
BackColor or Font), etc... from my configuration file, the childButton
(inherit from MyButton) doesn't change.
It is due to "Windows Form Designer" that in InitializeComponent, when i
drag the chil control over the form, add some code and set properties.
Is there any solotion for this problem?
How implement visual inheritance corretly?

Thanks in advance,
sorry for my english.

epederiva


Nov 15 '05 #2

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

Similar topics

2
by: Matt | last post by:
I have created an MDI child form that I am using as a base form in a VB.Net MDI application. The base MDI child form has a series of menu options on it. I then use this form to create other MDI...
1
by: Jason Hickey | last post by:
Has there been a change in the way the UI designer handles winform inheritance in the 2003 version of visual studio. Consider the following (try it if you are using 2003 Everything seems to work...
10
by: Gopal Prabhakaran | last post by:
Hi Pls Help me to do Visual Inheritance with ASP.NET -- Thanx Gopal Prabhakaran
6
by: VR | last post by:
Hi, I read about Master Pages in ASP.Net 2.0 and after implementing some WinForms Visual Inheritance I tryed it with WebForms (let's say .aspx pages, my MasterPage does not have a form tag itself...
2
by: Ray Cassick \(Home\) | last post by:
Since I got such good feedback from the Xml comments question I will ask this of the group as well. Is VS.NET 2005 handling the visual inheritance problems centered around controls and forms...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.