Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More about tabbing out of grids
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00368227
Message ID:
00368249
Views:
21
>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.

Probably you could try to intercept the Shift+Tab in grid and issue KEYBOARD '{CTRL+TAB}' (you may try to do it in Form.KeyPress() )
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform