473,385 Members | 1,464 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,385 software developers and data experts.

Toolbox User Control System Wide Changes By Inheritence Does Not Work. Why?

I want to create, via inheritance, my own UI control and use it in place of
the stock .NET control in order to make system wide changes easily.

For instance, I would inherit from Forms.Button and make a new class
MyButton. My app would then use MyButton everywhere instead of Forms.Button.
If I wanted a new look-and-feel, I could override the default attributes
from within the MyButton constructor (e.g. color, etc...).

However this doesn't work. Visual Studio picks up any attributes I set from
within the constructor and hard codes them within every
InitializeComponent() that I use MyButton. If I update the MyButton
constructor, all the hard coded InitializeComponent() calls override my
constructor update.

For instance, if the MyButton constructor has:

this.Dock = System.Windows.Forms.DockStyle.Top;

When Visual Studio uses my control (placed within the Toolbox), it inserts
this code in InitializeComponent():

this.dsPanelTitleBar1.Dock = System.Windows.Forms.DockStyle.Top;

How can I fix this?

I am using VS.NET 2002.
Jul 21 '05 #1
0 1170

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

Similar topics

2
by: migue | last post by:
way below newbie level: I know nothing about .Net. Have a VB6 client-server application (business app, inventory, purchasing, invoicing, etc.) and am considering converting it to VB.Net at a...
0
by: Dave | last post by:
I'm creating a custom control. To start, I created the control in a seperate project in the same solution. I didn't change anything from the template vs.net creates for a web custom control, I...
9
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do...
10
by: Nak | last post by:
Hi there, I'm having problems with the Toolbox in VB.NET 2002 Standard. I have 2 class libraries, 1 contains licensing classes and references nothing but standard namespaces and the other...
0
by: Dave L | last post by:
I want to create, via inheritance, my own UI control and use it in place of the stock .NET control in order to make system wide changes easily. For instance, I would inherit from Forms.Button and...
11
by: John J. Hughes II | last post by:
I have a DataGridView displaying data from a DataSet. To the right of that I have a custom user control which displays one of the data set fields. The custom user control is bound to the data set...
1
by: rudjohn | last post by:
I've been tasked with the not-enviable job of creating an application with multiple, semi-customizable templates. My basic concept, thus far, has been a combination of Master Pages (for layout) and...
5
by: John Kotuby | last post by:
Hi all, This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. I created the control in a separate Web Control Library...
1
by: JTC^..^ | last post by:
When I create a custom control inside my Windows Application project it does not appear in the toolbox. I'm using Visual Studio 2005 (Team System for Developers), so this should appear...
1
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.