Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling grids - losing focus - part II

Status
Not open for further replies.

Raccoon

Programmer
Aug 18, 1999
92
US
When I leave a grid I want to go to a particular object. I can not set focus from a click or valid statement. I do not see a lost focus method in the grid properties. Am I just missing it? If not, how do I control where the focus goes when leaving it. Changing tab order does not seem to be the answer.

I have a text box that updates a grid as I type in it. When I get enough of a name to get close to the right one, the user clicks on the grid, scrolls up or down until the name they want appears, and hit enter or click on it (they might do either, you know how users are).

The valid statement is setting things up to return to the main controls, for instance, changing index order, table selected, etc... It needs to execute just before focus is lost.

I also do not see a keypress event in the grid, so I can't set focus from it if the user presses enter. If the only set focus command is in the click event, how do I control focus change if the user presses enter?


Thanks,

Mike
 
You can put something like ThisForm.txtNextTextBox.SetFoucs in the grid textbox keypress event. Right-click on the grid and select properties. In your "Properties" dialog, click on the grid drop-down and scroll down until you find the correct column and under that, text box, and select it. In the properties list, select the KeyPress event and put in the above statment corresponding to the next control you want to obtain focus.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top