LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching tabs programmatically not working?

Solved!
Go to solution

I'm trying to create the interface of my program using a tab switcher, and then using buttons to navigate programmatically. However... the buttons do not seem to switch the tabs. Occasionally one will work, but 99% of the time it fails. I have attached a simplified version to demonstrate this problem.

 

I suspect this is a bug -- running the program with highlight exection works perfectly.

 

Thanks for your help.

 

 

0 Kudos
Message 1 of 6
(2,995 Views)

I am not sure if this really expected behavior what you are seeing.

 

But you have to certainly clean up your code.

 

I made some tests and the recommended way to solve is the following:

1.) Put the terminals of the buttons in "their" event case

2.) Change the event from "mouse up" to "value change". It should work then.

 

Norbert

 

EDIT: The more i think about this i can explain the behavior by the following guess: mouse up does not initiate a re-draw event for the UI, so the tab control simple doesn't get redrawn with the new active tab.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 6
(2,979 Views)

I see the same thing with highlight vs non. However, I have not seen many uses of buttons and event structures that are not latch-when-released, and value-change:

switchtabworking_BD.png

0 Kudos
Message 3 of 6
(2,973 Views)
Solution
Accepted by topic author pinchies

I have seen similar things in the past, where a tab control does not switch when using a local variable. Using a value property node instead solved the issue, probably for the reason Norbert suggested - it forces a redraw.

 

That said, I agree with the others that I wouldn't do it like this.


___________________
Try to take over the world!
Message 4 of 6
(2,962 Views)

Thanks -- using a property value works. You said you wouldn't do it like this -- is there an alternative you would do? I'm trying to make the interface for this program event driven, and this seemed like the simplest way.

0 Kudos
Message 5 of 6
(2,922 Views)

There's nothing necessarily wrong with using a tab control and controlling which page is displayed programmatically. I was refering more to the style (value change, terminals inside event cases, not having race conditions, etc.).

 

There are also other alternatives like having each step in a separate VI and displaying it in a subpanel, but that can be more complicated.


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(2,903 Views)