LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to select which page in a tab control is displayed programmatically. I don't wish to hide tabs, just choose which is on top.

I guess this is what I get for re-opening a 9 year old question.  All I wanted to do was clarify the answer to the fundamental question.  As someone who has only been programming LabVIEW for two years, I know I appreciate the simplest explanation first.  You don't NEED enum, typdefs, etc.  just to get the tab to show, but they are certainly all viable options.

0 Kudos
Message 11 of 20
(1,019 Views)

I'm going to provide a brief description of enum for new users.  If you are comfortable with using enum, no need to continue.

 


An "enum" is just an element of an enumerated list.  For example, I have 4 tabs on my tab control, in the following order

 

Calibrate

Run

Pause

Results

 

On the Front Panel, I use the "hand" selection tool to select the "Pause" tab by clicking on it.  I then go to the terminal for that control on the Block Diagram (because you cannot create a constant on the front panel).  I right-click on the terminal and select Create, then Constant.  The resultant enum is placed on the Front Panel.  It will display the word "Pause"

 

If you use the "hand" selection tool and click on the enum, you will see the above list of four items with a checkmark next to "Pause".  That list is the "enumerated list".  Each item is associated with an integer:

 

0 - Calibrate

1 - Run

2 - Pause

3 - Results

 

At this point, using the "hand" selection tool, I could click on one of the other items on the list and its name would be displayed on the enum and its value would be the associated integer.

 

A single enum is one item from the enumerated list, displayed as a name rather than a number, but the VALUE used in the program is always the associated integer and not the string of the name.

 

The primary advantage of using enums is that you don't have to memorize which tab goes with which integer.

 

The primary disadvantage, as has been pointed out, is that the enumerated list changes when the number of tabs changes or when the tabs are renamed.  Previously created enums would have to be carefully examined an replaced, as required.

 

Thanks to the very, very knowledgeable people who contributed.  I wish someone had given me this simple explanation when I was starting.

Message 12 of 20
(1,009 Views)

Just go to front page of your program. On the tab control switch to the page you want to display first. Right click on your tab control->Data Operations->Make Current Value Default.

0 Kudos
Message 13 of 20
(562 Views)

Why is your first message to a 15 year old thread that was last replied to 6 years ago.  And provides an answer to a completely different question than the one that was asked?

0 Kudos
Message 14 of 20
(552 Views)

Good question, but shouldn't that be on another thread ?  🙂

0 Kudos
Message 15 of 20
(533 Views)

RavensFan,

 

That's a bit of a snarky way to welcome a new potential enthusiest to the LabVIEW / NI community.  I have appreciated many of your posts in the past, but I don't appreciate this type of synical badgery.  I noticed that over the last few years these types of responses are becoming more prevalent in these forums which makes it hard for newcomers and veterans alike to feel comfortable about asking for help and suggestions from the pros.  There are plenty of other low-class trashy internet forums where trailor trash talk is the norm - let's not make our professional NI forum one of them.

 

Welcome TheFraten,

I think you will more typically find that these forums are generally frequented by patient and helpful developers.  I have learned a lot by reading through posts here, and I think you will advance your knowledge base quickly as well through the examples and real-world problems that other users talk through.

 

-10

Message 16 of 20
(515 Views)

There is no logical reason for a completely new user to post a useless response to a 15 year old thread.

 

My message wasn't "snarky".  It was a pretty straight forward question and comment.

 

 

0 Kudos
Message 17 of 20
(511 Views)

Thank you all for your kind welcome and informative reply.

0 Kudos
Message 18 of 20
(484 Views)

Fan, I am sorry that I misinterpreted your post and I apologize for my rant.  You are a great asset to the discussion forum boards and I always appreciate your intelligent insight to user's problems.  Thank you for your continued contributions. -cb

Message 19 of 20
(464 Views)

@10Degree wrote:

Fan, I am sorry that I misinterpreted your post and I apologize for my rant.  You are a great asset to the discussion forum boards and I always appreciate your intelligent insight to user's problems.  Thank you for your continued contributions. -cb


Welcome to my world...

 

I'm forever apologizing on the forum.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 20 of 20
(445 Views)