Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C#.Net Newbie Question - Subclassing A Button
Message
De
03/10/2005 14:12:31
 
 
À
03/10/2005 14:01:21
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01017131
Message ID:
01055574
Vues:
23
Hey, Yuriy,

Just as a follow-up, I learned one additional thing after making that post. So here is the code I'm using now:
public class MyTextBox : System.Windows.Forms.TextBox
{
     public override Font Font 
      { 
        get { return base.Font; } 
	set {base.Font = value; }      // new line
	}  

	public MyTextBox()
	{
	base.Font = new  Font("Tahoma",8);
        }
}
The code I previously posted would handle the inheriting the way you'd expect....but didn't allow you to change the font in the property sheet. You were totally restricted to the font defined in the base class. The small change above allows you to do so.



Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform