LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid a tab control changing page when typing the key associated with a disabled control.

Hi.
I have a VI with a tab control with several pages, which I use as different "screens" of my VI.
Each tab page has a few controls, some of which have key navigation configured.
When I am in a particular page, the controls in that page are all enabled, and the controls for ALL other pages are ALL disabled.


The problem I am having is that when I am, for example, in page 1, and hit the keyboard key associated with a control in page 3, the tab control switches to page 3, even though the control is disabled.  Since the tab control shows no tabs, and all the controls in page 3 are disabled, there is no way for the user to return to the "active" page 1.

I am surprised to find out that even though the control is disabled, that tab changes pages.

An undesirable solution for this problem is to use property nodes for each control and write to the key navigation property each time the tab changes pages.  It seems like a very complicated solution, and I wanted to ask if anybody knows of a better way of solving this problem.

Thanks,

Alejandro
0 Kudos
Message 1 of 5
(3,039 Views)
even when a control is disabled I believe it will still fire some events, Do a search on events and you will see some discussions about this very same thing



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 5
(3,029 Views)
The solution that I used is to disable the entire tab page. Disabling a page also disables the controls on it and the user can not switch to that page.

I have included my original (though modified) test program. When you run it, it will take the enabled states from the array and apply them to the tab pages. Then it sits in a loop waiting for the user to press "stop". The 3 buttons are set for key navigation F1 to F3 (respectively). Try it and you'll see that you can not activate that control or go to that page.

Have fun.

     Rob
Message 3 of 5
(3,023 Views)

There are some known issues with tabbing to controls on disabled pages of tab controls that have been fixed in various LabVIEW versions.  If you can attach a simple VI that demonstrates the problem, I can figure out which version of LabVIEW has a fix for the issue.  What version of LabVIEW are you currently using?

-D

0 Kudos
Message 4 of 5
(3,021 Views)
Hi.

I am using LabVIEW 7.1.  I have tried the solution proposed by Rob, and it seems to do the trick for me!

Thanks!

Alejandro
0 Kudos
Message 5 of 5
(3,000 Views)