Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing a subclass
Message
From
07/10/2007 00:16:40
 
 
To
06/10/2007 22:49:49
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01256172
Message ID:
01259226
Views:
20
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform