11-16-2009 04:42 AM
Hello guys'n'gals!
I have a small program where the user is supposed to select some information from several Listboxes. Currently they can ofc move between these boxes with tab (i have a decent tab order), but they want to be able to use the arrow keys as they select by up/down in the boxes already.
So how can i call a <tab> on front panel?
(I'm trying to perform it in a key down event on <left> and <right> instead)
/Y
Solved! Go to Solution.
11-16-2009 06:14 AM
Best way to do it, without using a dll, is to use the "Key Focus" property, when an arrow is pressed.
Use the key down event, as you wrote.
Build an array of references, of your controls, and each time an arrow is pressed, pass the next value of the array,
to the "Key Focus" property
11-16-2009 06:26 AM
I'm doing something similar, i'm using the controls[] from Pane, but it seems it's in 'almost' reverse tab-order (thus i must lower the index to move "forward"), and 2 occur in a different order to my tab order which i find strange. I assumed the Controls[] order _was_ the tab order ...
Anyway, now it stops in the middle of my controls, probably due to a hidden control.
Hmm, i'll use your idea of building an array of the visible controls.
/Y
11-16-2009 06:31 AM
11-16-2009 07:08 AM - edited 11-16-2009 07:10 AM
Thanks for trying, i'm skipping it for now. I got stuck in a comment textbox from which i really dont want <Right> to leave the box and so on. They'll have to tab. 🙂
*update* Didn't see tst's comment. Suddenly it got interesting again ... i'll make a quick test.
/Y
11-16-2009 07:35 AM
There is a good blog-post on how to create a dynamic tab order here.
Ton
11-16-2009 07:49 AM
Key Down? - event was the key! 😉
Small and pretty solution, me like.
/Y