Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing - NEWBIE!!
Message
De
13/03/2004 23:23:27
 
 
À
13/03/2004 14:55:44
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00885724
Message ID:
00886051
Vues:
18
"Their answer, well, you can just do a find and replace... "

(Deep sigh), yeah I've heard that one before ;)

Unfortunately, there's a rather odd feature in VS.NET that negatively affects inheritance.

If you do the following:

1) Create a textbox class, set the font to be Arial 8
2) Add the textbox class as a reference to the VS.NET toolbox, so that you can drop it onto a form
3) Drop the textbox class on a new form
4) Pull up the property sheet, and change some properties on the inherited textbox OTHER THAN the font
5) Now the client tells you a month later that they'd rather use Arial 9. Go change it in the textbox class.

Unfortunately, the Winform designer generated code in the form when you dropped the control on the form and changed some properties (in steps 3/4).
That code included the font definition. So the font change to the base class in step 5 doesn't get recognized in the form.

The only way to 'reinherit' the font change is to pull up the property sheet for the inherited control, right-click on font, and click RESET. That will set it to Arial 9.

Not a huge problem for one form, but if you have a bunch of forms...

Bonnie and others have offered some workarounds for this - but this is behavior that will really surprise VFP people, as VFP seems to deal with this type of inheritance better.

Kevin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform