Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with commandbuttons class
Message
De
16/04/2009 07:37:21
 
 
À
15/04/2009 22:03:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01395069
Message ID:
01395090
Vues:
182
>I have a series of data entry forms with add edit delete buttons. I created a class so I can just drop these buttons to the forms.
>
>In my previous applications, I would drop these buttons in my forms and edit each buttons in the forms to include the code below
>SET MULTILOCKS ON
>=Cursorsetprop("Buffering",5,"Employee")
>=Tableupdate(.T.)
>
>I do this for every data entry forms and just modifies the table name.
>
>I wonder if I could just put the code above in my buttons class, then possibly pass the name of the open table to the class?
>
>How can I achieve this?

I would argue that SET MULTILOCKS ON and the CURSORGETPROP belong at the form-level, not in your button class. Put SET MULTILOCKS ON in the Load method of your "base" form class. If you use the data environment, set up buffering for the tables there. If not, put that code wherever you open the tables, or in your "base" form class, add code that loops through all open tables and sets up buffering.

The TableUpdate() does belong in your Save button (but I wouldn't think in any other) and yes, you can set that up in the button class. Just add it to the Click method of that button.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform