LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TAB control move in out

Solved!
Go to solution

I would like to swap 2 charts:  1 is inside a Tab control, the other is located outside the TAB control.

 

Problem: The tab control extends when I swap position and I don't want that.   I just want the charts to swap without modifying the TAB-control.

 

Thanks in advance!

0 Kudos
Message 1 of 6
(3,064 Views)
Solution
Accepted by topic author _Xilinx_

I don't think you can add/remove objects from a tab control at runtime easily.

But I'm sure there's another solution:

  • If only one graph is visible at a time you can place both graphs on top of each other and use the visible property to switch
  • Use only one graph and feed it with the appropriate data
  • Keep both graphs, but instead of switching graphs just switch data
  • Have both graphs outside the tab control and just move them "over" the tab control programmatically (like what happens to your "Graph outside"). If you use this solution you'll have to show/hide the graph when switching tabs since it would be on top of all tabs.
  • ...

 

Message 2 of 6
(3,053 Views)

Thanks, I will assume that moving something out of a container on runtime is NOT possible. Robot wink

 

I will place the graphs I want to switch in an additional TAB control and switch those pages.

 

(Solution attached LV8.5)

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

@_Xilinx_ wrote:

Thanks, I will assume that moving something out of a container on runtime is NOT possible. Robot wink

 



Well, I didn't play much with scripting so it might be possible. Not sure if it would work on a running VI though.

 

0 Kudos
Message 4 of 6
(3,041 Views)

You can do this one of two ways:

 

  1. Implement the charts as subVIs and use subpanels at the two locations.  Just swap which subpanel owns which chart and you are good.  If you need an introduction to subpanels, look in the LabVIEW help or here.
  2. Instead of swapping the charts, swap the data on them.  You can read the history from each, clear both, then rewrite the data to each.  You may also need to change plot colors, axes, etc.
0 Kudos
Message 5 of 6
(3,025 Views)

See here for example of inserting/removing from sub-panel

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(3,015 Views)