Can a Combo Box control a Tab Control, like an Enumerated Ring control can

Can a Combo Box control a Tab Control, like an Enumerated Ring control can

Post by stressmat » Thu, 16 Nov 2006 05:40:07


Is there any way to have a Combo Box control a Tab Control.  An Enumerated Ring control can if all the names match "Exactly", question is can a Combo Box do the same, especially within an Event Structure?

I haven't been able to figure it out.  Enclosed is a test VI that has an enumerated ring example, and a combo box with the same data.  Thanks for your help...


Test Tab Control [1].vi:
http://www.yqcomputer.com/ [1].vi
 
 
 

Can a Combo Box control a Tab Control, like an Enumerated Ring control can

Post by smercurio_ » Thu, 16 Nov 2006 06:10:09

A tab control can be treated like an enum, so your question comes down to: "Can I map a string value to an enum?" The answer is yes. Take the enum's array of strings, which can be accessed via a property node, and search the array for your string. See below pic:<img src=" http://www.yqcomputer.com/ %201d.png"> Now, as to your VI. :smileysurprised:A couple of things:- You don't need to use separate event structures to handle separate controls. Just use one event structure with different event cases.
- You might want to really rething your user interface. If I were a user asked to operate your VI my head would be spinning very quickly. Those tab controls are extremely unwieldy. Tab controls aren't meant to be used with 35 tabs.
Message Edited by smercurio_fc on 11-14-2006 02:50 PM


Untitled 1d.png:
http://www.yqcomputer.com/

 
 
 

Can a Combo Box control a Tab Control, like an Enumerated Ring control can

Post by stressmat » Thu, 16 Nov 2006 07:10:08

Thanks for the reply, but in the real user interface the tabs are hidden, and there are several other controls on each tab.  The real question is:  how can i select the correct tab using the combo box as the control.  ie.  if I select, in this example, the combo box labeled COMMAND, to "Get CCU RX Status (R4)" then I want the tab with the same name to be selected, but is does not.  Where the Enumberated ring labeled "2aryProcCmd" does select the correct tab control.  I left the tabs showing just so you can see which tab is really selected.  Its part of a user interface where the user can select the combo box selection and the correct tab is selected with instructions and controls to execute a specific command.  It seemed to be a clean way of doing the user interface.  Right now to get it to work I have to have a multiple case statement in the event structure that has the correct constant driving the tab control.  So when I want to add or edit a command I have to go through all 35 cases and change the constant.  Very time consuming and not very elegant. 
What you indicated as the solution, I think would change the combo box from the tab control and not the other way around.
Thanks.