Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing a subclass
Message
De
07/10/2007 00:16:40
 
 
À
06/10/2007 22:49:49
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01256172
Message ID:
01259226
Vues:
19
>Does this mean that any property (color, font, text) that you want to see at design-time must be overriden at base.property level?

No, this particular problem that you had with the .Text property of a control is kind of special and that's because the IDE sets it when you drop the control on a design surface. You wouldn't normally handle it this way for other properties. Normally, all you need to do is set it in the constructor.

~~Bonnie



>Hi Bonnie,
>
>>Do the same thing as you did for Font in your base class, override the Text property.
>>
>>
>>	public override string Text
>>	{
>>		get { return base.Text; }
>>		set { base.Text = "Edit"; }
>>	}
>>
>
>That does the trick - many thanks. Does this mean that any property (color, font, text) that you want to see at design-time must be overriden at base.property level? Seems to defeat the object of inheritance to me.
>
>Alan
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform