LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab Control Question

Solved!
Go to solution

Is there a way to programmatically assign a control to a particular page of the tab control?  I am programmatically repositioning a control from outside the Tab control to within one of the tabs.  Then, if I click on a different tab, the control is still present in the second tab which I don't want. 

That doesn't happen with controls that are originally located in the first tab.  I see that there is an owning pane property that can be read from a property node, but it cannot be written to.  I'd prefer to not have to move the controls again when the active tab is changed.

0 Kudos
Message 1 of 5
(2,245 Views)

Hi rreis,

 


@rreis wrote:

Is there a way to programmatically assign a control to a particular page of the tab control?  I am programmatically repositioning a control from outside the Tab control to within one of the tabs.  Then, if I click on a different tab, the control is still present in the second tab which I don't want. 

That doesn't happen with controls that are originally located in the first tab.


You need to "drop" controls onto their related tab pages (using the mouse) to position them "within" this page. Just moving them (either using cursor keys or "programmatically") will only position them "over" the tab control.

 

(Usually we have to explain the other way around: how to position controls "over" a tab…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,220 Views)
Solution
Accepted by topic author rreis

Something like this VI may work for you. Instead of moving the control, create a duplicate in the other position you're looking for and control which is visible based on your tab's value. This way you don't need to worry about moving the control at all (which always causes headache in my experience)

Outside Inside CTL.png

Message 3 of 5
(2,211 Views)

Of course it would be even easier if you simply put one control on the first page, and another on the second page. You wouldn't need to move or show\hide at all.

 

This will become cumbersome if you have 50 pages...

 

If you do have 50 pages, and the position and\or visibility is arbitrary, I'd argue that setting the position is easier:

 

Move Control.PNG

 

Duplicating controls also means setting all values for each of the duplicates, duplicating value change events for each of them, etc...

0 Kudos
Message 4 of 5
(2,190 Views)

In my case, I'm trying to create a dynamic form on one tab that shows different controls depending on the options that you select.  The point of moving the controls was simply to make them appear or disappear depending on what's selected.  So, I was storing them off the screen until they were needed.  It works well on a normal pane, but add in the tab control and not so much.  Using the visible property achieves a similar effect, but it can be a little painful to deal with if you lose track of invisible ones or you want them to be located in the same position.  Plus, now I'm going to have to make a lot of changes to implement it that way.

0 Kudos
Message 5 of 5
(2,174 Views)