Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing Common Controls
Message
De
03/11/2009 11:05:00
 
 
À
03/11/2009 01:19:27
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Divers
Thread ID:
01432616
Message ID:
01432958
Vues:
48
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform