Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Chuck:
As someone else pointed out, the current work area can sometimes change on you when you are using grids. An easy to circumvent some of the problems is to specify the table alias in all your GO, SKIP, RECNO, BOF, EOF to ensure that all data pointer movement and checking occurs in the desired table.
If you have more than one form that uses your navigation buttons, I suggest that you create a custom property named something like MasterAlias (at the class level if your forms are based on a subclass of the VFP form, at the Form level if they are based on the VFP form) and that you store the table alias of the master table in that property. Assuming your buttons are saved in a class library (you can always select them and use File, Save As Class) you can then
code something like GO TOP IN (THISFORM.MasterAlias) in your Top button, etc... and have the absolutely nothing to code in the Click event of this button on any of your Forms. Class methods are usually a little bit more difficult to write because they have to be more generic but you will find that they are easier to maintain (you change the code only at the class level, there is no need to open all your forms). They will save you a ton of coding effort in almost any project and even more so if you reuse them in other projects.
Good luck,
Daniel
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement