LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Key focus and tab control

I have a program I am working on to test a product.  On the front panel I have key focus on a string control so that our service techs can scan a barcode.  I then wanted to have a tab so that the user could pull up a page with different information on it.

 

The problem: With key focus on, it immediately brings the tab back to the first page where the control is.

 

I have tried to conditionally turn off key focus when I change tabs, but then it jumps back to the original tab before the focus gets turned off.  Is there a good way to programatically turn on and off key focus based on which tab is active?  I know I could keep that control outside the tabs, but it doens't look right and there is no need for the user to input anything into that box if any other tab is up.

 

~Thanks

0 Kudos
Message 1 of 4
(3,354 Views)

How exactly are you setting key focus. It should only need to be done once at the beginning and again when a value change event happens on the tab control. You woudn't be doing it continuously in a loop, would you? If you have more than the base version of LabVIEW, use an event structure.

 

p.s. keeping a control outside the tabs does not affect the appearance when the VI is running.

0 Kudos
Message 2 of 4
(3,348 Views)

I've just started learning how to use event structures and was looking at doing that.  I'll have to dig into that more.

 

This is also my first time using tabs, and I'm confused about your comment regarding the control appearance.  In order to keep a control outside a tab, wouldn't it be visible regardless of which tab you select, because it is for example in the space above?  In which case it would appear different than if I had it in the tab and therefore only visible when that tab was selected.

 

Thanks.

0 Kudos
Message 3 of 4
(3,332 Views)
I understood your comment about the control above the tab as meaning you did not like the 'floating' appearance which disappears when running. You are correct that the control would appear to be on all tabs. Since this is not something you really need, you should probably concentrate on learning about the Event structure.
0 Kudos
Message 4 of 4
(3,326 Views)