Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing Common Controls
Message
From
03/11/2009 11:05:00
 
 
To
03/11/2009 01:19:27
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01432616
Message ID:
01432958
Views:
50
>Suppose I later want to add a single item to the contents of the combo(making it 5 items) for a single instance of the UserControl, will I be able to?

Yes, as Viv said, you can do this. Either by exposing the ComboBox as a public property, or by having a public method that will add whatever you pass it as a parameter.

>And will I be able to add a method to it as well?

The only way you'll be able to add any methods is to further sub-class it and add your new methods to the sub-class.

~~Bonnie




>Hi Bonnie
>
>Yes. UserControl was the term to use not Component. However, the question still remains that if I do create a UserControl, will I be able to add/override functionality when I use it?
>
>For instance the combo box(in the image) now displays a choice of 4 items - AMEX,VISA,BCARD,OTHER
>
>Suppose I later want to add a single item to the contents of the combo(making it 5 items) for a single instance of the UserControl, will I be able to? And will I be able to add a method to it as well?
>
>>Hi Bernard,
>>
>>You'd want to use a UserControl for this rather than a Panel (you can stick the Panel on the UserControl if you want to). The UserControl *can* be visually designed.
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform