Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does Visual Inheritance work in .Net?
Message
De
19/06/2007 21:09:05
 
 
À
19/06/2007 16:07:34
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01234107
Message ID:
01234414
Vues:
9
You *do* *also* need to set the property in the constructor. Why did you comment that out?

~~Bonnie



>Calvin,
>
>If you've got it working the way you want, that's fine....but I believe the following is what's best (to start from scratch)...
>
>
>public class MyLabel : Label
>{
>
>	DefaultValue(typeof(Font),"Verdana,8pt")]
>	override public Font Font
>	{
>	   get { return base.Font; }
>	   set { base.Font = value; }
>	}
>
>	public MyLabelClass()
>	{
>	     //  base.Font = new  Font("Verdana",8);   // no need for the constructor if you're using defaultvalue attribute
>	}
>}
>
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