Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to exit Ingrid once row found
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00095581
Message ID:
00117003
Vues:
22
>>I'm using Ingrid 1.5 to locate specific records in a table. Once the user has located the correct record and positioned the cursor anywhere on that row, I would like to be able to press ENTER to exit the grid and have a series of actions performed.
>>I've tried trapping chr(13) in the keypress method without success.
>>
>>Any help would be appreciated.
>>
>>Alex Shoob
>
>Are you trying to trap the ENTER in the InGrid control, or the form?
>
>The InGrid control traps the ENTER key itself if it is in the process of a search to signal the end of the search and the restoration of the column caption.
>
>If the entire functionality of the form is the grid to search, I would set the form's KeyPreview to .T. and trap for the ENTER keypress in the form's KeyPress event; otherwise, you may need to trap for ENTER in the keypress for each control in the grid (The ingrid controls and any other controls). For the Ingrid control make sure to call the default class behavior.
>
>---Scott.

Scott:

I'm not sure that I follow the above. I ended up modifying InGrid.vcx by adding the following to the KeyPress Code
CASE m.nKeyCode=13
THIS.lInGridActive = .f.
thisform.release
This seems to work in that it closes the form and places the user on the correct record. I assume that I could add other code that would leave the form and grid active but take other actions.

Whenever I tried to place any code in the KeyPress of the Ingrid control on the grid, every keystroke produced "This control is read-only" errors.

Alex
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform