Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More about tabbing out of grids
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
More about tabbing out of grids
Divers
Thread ID:
00368227
Message ID:
00368227
Vues:
34
I'm still trying to perfect my code for making grids and their columns work like normal controls regarding tab order. I want users to be able to leave a grid by pressing Tab or Shift-Tab rather than Ctrl-Tab. I made text box classes with code in the Keypress events that do a .SetFocus(othercontrol) when it receives a Tab or Shift-Tab. "othercontrol" is kept in a custom property of the classes. I put these boxes in the first and last column of each of my grids and set the custom properties to the names of the next and previous controls in the tab order.

Instead of specifying the name of the next/previous control in the tab order, I would like to set focus automatically to the control that comes after/before the grid in the tab order. I tried calling grid.Valid but it didn't help. I could try looping through all the controls in THISFORM.ControlCount and set focus to the one that has .TabIndex = Grid.TabIndex + 1 or - 1. That seems slow and inefficient for forms with many controls. Also, I'd have to make sure that there was such a control in each form. Is there a better way? In effect, I want something like a "Losefocus" for the grid.

Note that in another thread, Dave Frankenbach helped me solve this problem for the case where there are no records in the grid.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform