LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I move keyfocus on different contols using a keybord input?

I have a VI with two string controls and a OK button to simulate a text input box. One control takes login name and the other password. When OK button is pressed end the execution. I set keyfocus on the first control and want to move the keyfocus when I press tab key on the keyboard. And next time I press the tab key again move the keyfocus to OK button. This is easy in VB. I am not sure how to do this in LabView environment.
0 Kudos
Message 1 of 5
(2,990 Views)
This happens pretty much automatically in LabVIEW. To check out what order the controls will be accessed from the Tab key, select Edit->Set Tabbing Order... from the menus. You can then change what order the controls are in.

When the user presses tab, LabVIEW will already move the keyfocus from one control to another (unless ou turn this feature off or change the focus programmatically).

Rob
Message 2 of 5
(2,990 Views)
It works as I anticipated. This is the answer. Just out of curiosity how would you programmatically control the order. I think turning the order off will use property settings of contorls to false. To program the order of keyfocus I need to know what user is typing and whenever tab is pressed I need to set keyfocus property to true. Not sure how to read user'skeyboard input.
0 Kudos
Message 3 of 5
(2,990 Views)
You can't change the tabbing order programatically, but you can allocate the key focus programatically.

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 5
(2,990 Views)
I don't see what version you are using but if you have V6.1 or 7.0, then you have access to the event structure and one of the events that you can use is Key Down or Key Up. At this point you can read the scan code (Tab button = 15). Now you can programmatically move the key focus when someone presses the Tab key.

Hope this helps.

Rob
0 Kudos
Message 5 of 5
(2,990 Views)