LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i stop the tabs on a tab control from changing.

i have 2 tabs when i change data on the table tab i check it to make sure that it is correct if it is not than i disable the other tab.
the problem is that if i have the selection on the tab and then i click on the other tab it will change to that tab
0 Kudos
Message 1 of 6
(3,882 Views)
I know that it is not elegant, but you could make the tabs not visible or use the Page Selector Visible? property node when you want to disable the one tab and then use the Value Property node to make sure that the visible tab is the one that you want.  And then when you check and everything is ok, you can make it visible again and enable it.

Kenny
Kenny

0 Kudos
Message 2 of 6
(3,877 Views)
Kenny
i do not think that would work.
the reason i think that is that by the time the event structure has registered that the value has changed the tab has already changed
0 Kudos
Message 3 of 6
(3,873 Views)
Sounds like you want to prevent the tab switch from occurring in the first place, rather than act on the "Value Change" event and use that to switch back to the other tab if the data is "not correct". In that case you would need to use the "Mouse Down?" event and check to see if the mouse down occurred in the area where that tab is. If it is, and the data is "not correct" you just need to wire a "True" to the "Discard" output and the tab change won't occur.
0 Kudos
Message 4 of 6
(3,860 Views)
As a follow-up, if you decided to use the "Mouse Down?" event you could try something like the following, which prevents the switch if the numeric is greater than 10:


0 Kudos
Message 5 of 6
(3,854 Views)

Kind of way after the end of the story, but although the example shows a solution, it would be way easier to have a "Discard?" Boolean in a "Value Change?" case for this type of object (Tabs)... and arguably for any kind of object...

Has this been discussed somwhere before (and maybe even suggested)?

0 Kudos
Message 6 of 6
(3,350 Views)