Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to base all forms on a class?
Message
De
13/05/2007 11:11:06
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01225062
Message ID:
01225072
Vues:
20
>How can I base all my forms on a class ?

First create the class. Then, for any new form you want to create:
create form mynewform as myformclass of myformclasslib.vcx
For any forms that you already have, open the form in class browser (launch the class browser, click the open button, then in file types combo select Forms instead of class libraries), rightclick the form's name in the treeview on the left, select Redefine and in the dialog which will appear select your class library and your class.

>Do I have to edit any class of VFP ?

You cannot do that, they are defined in the runtime, but you can subclass them - that's what "create the class" means. Every class you create is actually a subclass of either one of your classes, or of a VFP base class.

>Will all forms behaive as the edited class or only new forms ?

Everything behaves as dictated by its parent class - be it your class or a base class - except where you override it by changing the properties or event/method code in the thing itself. See the first part of the answer on how to get your old forms to inherit from the new class.

Same goes for the controls on your form, but you need to redefine them (i.e. change their parent class) by hacking the scx (or vcx) - you need to open the scx as a table (use myform.scx, browse) and fill the Class and Classloc memos with the name and location of the class you want them to be for the records holding those controls. The classloc holds the relative path to the vcx. As with any other hack, backup first, you may get a few things wrong first few times, and when you close it, compile form myform so it will take your changes seriously.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform