LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to add a LED indicator to the tabs in a tab control

Solved!
Go to solution

I have a tab control with multiple rows of tabs. I would like to know if there is a way that I could add round LED indicators to each of the tabs so that I can quickly see the status of each page.  If I only have one row I can just allow for my LEDs to "hover" over the tab, but this does not work if there are multiple rows since the tabs change locations when they are selected.  Does anyone have experience with this?

 

Thanks in advance!

0 Kudos
Message 1 of 8
(3,746 Views)

No experience with this.  But you may need to determine which tab is active and change the positions of the LED's on the front panel programmatically.  For instance, if page 1-4 is active, then set the LED's 1-4 for the Y value and LED's 5-8 for the 2nd row's Y value.  If page 5-8 is active, do the reverse.  An event structure would probably handle this the best to detect the value change on the tab control.

 

(I'm assuming tabs 1-4 make up 1 row, and 5-8 make up another row.  Of course your situation would vary.  You would also have to experiment with what are the correct Y values for each of the rows.)

Message 2 of 8
(3,729 Views)

Heres a image of code that I made that may be applicable to what you need. It sets the LED for the specific case true and sets all the other LED's to false. You aren't able to put the LED on the actual Tab, but you could implement this to the side of the Tab Structure.

 

 

National Instruments
RIO Embedded Hardware PSE

CompactRIO Developers Guide
Message 3 of 8
(3,683 Views)
Solution
Accepted by new_labview_user

I decided to take some time (probably way too much time!) to try this out and prove it would work.  See the attachment in LV 8.5.1.

 

I used arrays and control references to make the code as scalable as possible.  I added several spaces at the end of each label name so that there was some room to place a very small LED.

 

The trickiest part (and I would save this until the tabs are named, laid out, and the overall tab control is sized) is to find the best location and screen coordinates for each LED.

 

I discovered for best looks, that the LED should jump up and to the left by 2 pixels when its specific tab is selected, just like the label text does.  Otherwise the LED's just jump around on the screen to match whatever row its respective tab is on.

 

I have the timeout event randomly turning on and off the LED's, but that would actually be handled by your other code and whatever events determine whether the LED should be on or off.

Message Edited by Ravens Fan on 09-17-2008 11:59 PM
Message 4 of 8
(3,669 Views)
Thanks so much for your help Raven's Fan! I was able to get this to work for my project.
Message Edited by new_labview_user on 09-18-2008 12:25 PM
0 Kudos
Message 5 of 8
(3,641 Views)
Thanks for the idea and the screenshot Andrew_E!
Message Edited by new_labview_user on 09-18-2008 12:25 PM
0 Kudos
Message 6 of 8
(3,640 Views)
Alternatively, you could just change the color of each tab page.  Green means one thing, gray means another, red means another...
Message 7 of 8
(3,612 Views)
Thanks Jeff that is also a good suggestion.
0 Kudos
Message 8 of 8
(3,584 Views)