Stephen Ollinger
March 27th, 1999, 09:35 PM
How do you trap the TAB key in a msflexgrid box? I want the TAB key to move to the next cell and not the next object.
Thanks,
Stephen
Thanks,
Stephen
|
Click to See Complete Forum and Search --> : how do you trapping the TAB key in msflexgrid control? Stephen Ollinger March 27th, 1999, 09:35 PM How do you trap the TAB key in a msflexgrid box? I want the TAB key to move to the next cell and not the next object. Thanks, Stephen Chris Eastwood March 31st, 1999, 05:51 AM Hi I did a 'slimy hack' to capture this a while ago - be warned though, the ideas pretty horrible, and your users won't be able to lose focus from the FlexGrid (using Tab) once it has focus. Basically I placed a textbox behind the FlexGrid and on it's GotFocus event, updated the Relevant Col/Row and then set focus back to the FlexGrid. Slimy, but it works Regards Chris Eastwood CodeGuru - the website for developers http://www.codeguru.com/vb Ravi Kiran April 1st, 1999, 08:16 PM Hi, It may be slighlty funny to expect your user to tab thru all the grid entries?.. anyway, you might try something like this: Catch the LostFocus event. Check if the focus is loosing because of 'tab' key press : because focus could be lost even by user selecting other control by mouse, and you might allow this!. To do this try the API - GetAsyncKeyState. It can determine if a h/w key stroke occured after the previous call to the same fn. So you should put the first call to this fn in GotFocus event. so if it says that a tab key was pressed, then set focus back to the grid, increment the current cell. This should probably be surrounded by some logic for boundary checking, get out on tabbing from last row-column cell etc. Happy tabbing. Ravi ps: I have tried this function only in one occasion,to detect a 'Esc' key press, while inside a long processing. It took some time to get it working. Also this API has some quircks relating to h/w. Please check MSDN on this API Tell me if it works for you also!! codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |