Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing a subclass
Message
De
07/10/2007 19:27:05
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
 
 
À
07/10/2007 11:52:36
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01256172
Message ID:
01259306
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform