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

Subclassing your own UserControl

Hi,

I created a UserControl, and created its UI with the designer. Next,
I wanted to create a subclass of that UserControl, with a new UI. But
when I open it in the designer, I see the UI components from the
parent class. When I step through the code, it looks like the
InitializeComponents of my base UserControl is getting called, and
then the version in my subclass.

Is there any way to prevent this? Is there a better way to create
subclasses of visual composition components?

Mar 23 '07 #1
3 2324
What are you actually trying to accomplish? The whole purpose of
subclassing is to extend the functionality of the parent class. Sounds like
you're trying to eliminate the functionality of the parent.

J

<ar*****@gmail.comwrote in message
news:11**********************@e1g2000hsg.googlegro ups.com...
Hi,

I created a UserControl, and created its UI with the designer. Next,
I wanted to create a subclass of that UserControl, with a new UI. But
when I open it in the designer, I see the UI components from the
parent class. When I step through the code, it looks like the
InitializeComponents of my base UserControl is getting called, and
then the version in my subclass.

Is there any way to prevent this? Is there a better way to create
subclasses of visual composition components?

Mar 23 '07 #2
On Mar 22, 11:03 pm, <rlrc...@newsgroups.nospamwrote:
What are you actually trying to accomplish? The whole purpose ofsubclassingis to extend the functionality of the parent class. Sounds like
you're trying to eliminate the functionality of the parent.

J

<arnc...@gmail.comwrote in message

news:11**********************@e1g2000hsg.googlegro ups.com...
Hi,
I created aUserControl, and created its UI with the designer. Next,
I wanted to create a subclass of thatUserControl, with a new UI. But
when I open it in the designer, I see the UI components from the
parent class. When I step through the code, it looks like the
InitializeComponents of my baseUserControlis getting called, and
then the version in my subclass.
Is there any way to prevent this? Is there a better way to create
subclasses of visual composition components?
Actually, I am trying to extend the functionality, but change the UI.
The base class has methods that apply to all the types of objects, but
each type of object has its own UI.

Mar 23 '07 #3
On Mar 23, 7:53 am, arnc...@gmail.com wrote:
On Mar 22, 11:03 pm, <rlrc...@newsgroups.nospamwrote:
What are you actually trying to accomplish? The whole purpose ofsubclassingis to extend the functionality of the parent class. Sounds like
you're trying to eliminate the functionality of the parent.
J
<arnc...@gmail.comwrote in message
news:11**********************@e1g2000hsg.googlegro ups.com...
Hi,
I created aUserControl, and created its UI with the designer. Next,
I wanted to create a subclass of thatUserControl, with a new UI. But
when I open it in the designer, I see the UI components from the
parent class. When I step through the code, it looks like the
InitializeComponents of my baseUserControlis getting called, and
then the version in my subclass.
Is there any way to prevent this? Is there a better way to create
subclasses of visual composition components?

Actually, I am trying to extend the functionality, but change the UI.
The base class has methods that apply to all the types of objects, but
each type of object has its own UI.
I decided to do it with an interface instead of a subclass.

Mar 23 '07 #4

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

Similar topics

2
by: BJörn Lindqvist | last post by:
A problem I have occured recently is that I want to subclass builtin types. Especially subclassing list is very troublesome to me. But I can't find the right syntax to use. Take for example this...
11
by: Brent | last post by:
I'd like to subclass the built-in str type. For example: -- class MyString(str): def __init__(self, txt, data): super(MyString,self).__init__(txt) self.data = data
1
by: S Guiboud | last post by:
I want to subclass the System.Web.UI.UserControl to make a common control for my site. Then, when I create a new UserControl from the Visual Studio I changed the base class...
0
by: Felbrigg | last post by:
Can anyone give me any pointers on Subclassing a TextBox. I do not want to create a UserControl.
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
6
by: --== Alain ==-- | last post by:
Hi, How can i do if i want to subclass WndProc from a control to MyNewWndProc ? in fact i have a UserControl on which i have another control (ListVire). And i want to subclass the WndProc of...
16
by: manatlan | last post by:
I've got an instance of a class, ex : b=gtk.Button() I'd like to add methods and attributes to my instance "b". I know it's possible by hacking "b" with setattr() methods. But i'd like to do...
5
by: Ray | last post by:
Hi all, I am thinking of subclassing the standard string class so I can do something like: mystring str; .... str.toLower (); A quick search on this newsgroup has found messages by others
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.