Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing
Message
De
30/07/2001 08:04:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00536237
Message ID:
00537116
Vues:
11
>So if I wanted to change the color of any forms in the new application, I would need to change APPBase AND APPData and so on?
>
>Is there a better way of handling this, or do you just have deal with it :)
>
>Thanks,

I hope I understood your question correctly:

Properties and methods can be inherited. Inheritance can be overwritten.

If you change the BackColor (?) of a form, it will not longer use the inherited value. The property will show in the property sheet in bold (you can "Reset to default" to restore inheritance).

If you change the BackColor - or any other property or method, for that matter - in a class, any forms (and classes) derived from that class will use the new value - except for forms where the inheritance is overwritten.

For methods, anything you write will break inheritance, but you can call the inherited method with DoDefault(), or with the scope resolution operator (::). You will hardly ever need the scope resolution operator, except in VFP3. DoDefault() (or scope resolution) allows you to run inherited method PLUS additional commands, or to run inherited method conditionally. (You need to take care both to pass parameters, and to return a value, if relevant.)

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform