Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does Visual Inheritance work in .Net?
Message
De
20/06/2007 14:43:12
 
 
À
20/06/2007 12:42:50
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:
01234558
Vues:
10
...because now you have to overwrite .NET font properties and write some additional code in order to ensure proper inheritance. Or am I just completely missing something here?

Just so that everyone is clear....the reason for this, is because the Winform designer generates code for the control in the form's InitializeComponent, when you drop the control on the form and start setting other properties for the control (like name, etc.).

The simple way to prevent this is to override the Font property and use the base keyword, in your subclass. That's IT...that's all you have to do, it's simply in your subclass class, and then inheritance will work cleanly. Very very small price to pay. Most .NET people just address it and move on to more important things.


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

Click here to load this message in the networking platform