Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LstListNavigator
Message
From
26/10/2002 14:20:58
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00715384
Message ID:
00715791
Views:
27
>One other small question about the grid. In the child form, I have the initial focus to be in the Grid. However, as soon as Tab is pressed, I need to move out of the Grid. Do you know what the normal way to handle this is?

I'm not sure I really understand the question <s>. OK, when the child form opens, you set focus to the grid and all is OK. So, you are now in cell 1, column 1, row 1 of the grid. The user has done nothing. There is at least one other column in the grid. Are you saying that if the first thing the user does is press the tab key, you need to move out of the grid? If so, what if the user is in a second or subsequent column of the grid - do you still want the tab key to move the user out of the grid?

If I am assuming correctly, then I feel that what you want to do with the tab key is non-standard behaviour. In my experience, most users would expect to jump to the next column in a grid if they hit the tab key. However, if you really want to do this, then probably the simplest way to do this would be to subclass the text box's keypress event and test for a tab key value. If you detect the tab value, nodefault it and set focus someplace else, where ever you want it to be. Of course, you would have to do this for each control in every column of the grid in the event that the user tabs from any of the grid columns.

Alternatively, you could put some handling code in the form's keypress event method to test for the tab key and react accordingly. This may be a little more generic in that you would avoid having to modify each column control, and just check to see whether you are currently in a grid container at the time the tab key has been pressed. If so, you could then set focus elsewhere.

I hope I have understood your question correctly.

HTH
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform