LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Objects on tab control switched pages

Solved!
Go to solution

I have a strict-type-def'd tab control and my various objects (controls, indicators, decorations) are on there respective tabs.  When I deleted the first tab from my tab control, all of the objects stayed with the n-th tab instead of moving with the tab name.  Now my tab context is all wrong.  Can someone help me?

0 Kudos
Message 1 of 13
(4,377 Views)

Can you post the type def?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 13
(4,371 Views)

Yes, but I see no reason to.  It is a tab control with four tabs.  There are no objects contained in the type-def'd tab control.  How will this help?

0 Kudos
Message 3 of 13
(4,368 Views)
Solution
Accepted by topic author kc64

OK I see what you mean-  I just created a STD tab control and added a bunch of stuff on one page in one instance of the control- edited the type def and..... got unexpected behaviors.  Deleting a page on the type-def removes the page on the instance but, not the controls on the page of the instance that are not part of the type-def.

 

I'm thinking this may NOT be a good coding practice and would avoid adding objects to a Strict Type def outside of the type def so that you avoid this undesirable behavior.  Edit the type def itself to add or remove objects.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 13
(4,358 Views)

This is the second time I've been bitten by the tab control behaviors.  I think I must find an alternative.  I can implement something similar with not much effort and have a fully-controllable solution.

 

Thanks for your help.

0 Kudos
Message 5 of 13
(4,354 Views)

How do you feel like you've been bitten? The behavior you are seeing is expected. Since the controls are not part of the type def, they should not be deleted when you edit the type def to remove a tab. I would feel bitten if the controls were deleted.

0 Kudos
Message 6 of 13
(4,348 Views)

Maybe that's the way you expected to see it.  I didn't.

 

I have tried to use tab controls on the front panel to organize things the way I would use a case structure on the block diagram,  ie. if I delete a case n, I don't expect all the case contents to switch to the n+1 case and leave my case 1 empty.  I clearly have a misunderstanding of how the tab control is supposed to work and don't think I will try to use them in this manner again.

Message 7 of 13
(4,345 Views)

Glad to have helped-  its a learning experience for everybody here! 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 13
(4,342 Views)

 


@kc64 wrote:

Maybe that's the way you expected to see it.  I didn't.

 

I have tried to use tab controls on the front panel to organize things the way I would use a case structure on the block diagram,  ie. if I delete a case n, I don't expect all the case contents to switch to the n+1 case and leave my case 1 empty.  I clearly have a misunderstanding of how the tab control is supposed to work and don't think I will try to use them in this manner again.


I just think it's a misunderstanding of how a type def works. If the controls had been part of that, then deleting a tab would have removed the controls. If you had not created a type def of the tab and had controls on a specific tab, then deleting the tab would have also removed the controls. You analogy to a case statement would have been correct only in these situations.

 

0 Kudos
Message 9 of 13
(4,330 Views)

Yes, I see that now.

 

As a challenge to myself, I have tried to make a tab control type def with controls on one tab page.  I cannot seem to instantiate it on any front panel or block diagram.  Any ideas?

0 Kudos
Message 10 of 13
(4,326 Views)