Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing a subclass
Message
From
07/10/2007 19:27:05
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
07/10/2007 11:52:36
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01256172
Message ID:
01259306
Views:
25
Hi Bonnie,

>
>public class MyTextBox : System.Windows.Forms.TextBox
>{
>	public MyTextBox()
>	{
>		this.BackColor = Color.Firebrick; ;
>	}
>	[DefaultValue(typeof(System.Drawing.Color), "Firebrick")]
>	public override System.Drawing.Color BackColor
>	{
>		get { return base.BackColor; }
>		set { base.BackColor= value; }
>	}
>}
>
This gets more complicated by the minute! It's at times like these that I can't help thinking of how simple it was to achieve the same thing in VFP. The thing I find most frustrating is that you have to declare the default color twice, once in the constructor, and once as a default value (to please the designer). Still, that's progress I suppose :-(

Must the DefaultValue directive always occur just before the override method for the corresponding property?

TIA
Alan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform