Example Code

Prevent Grayed-Out Tabs when Programmatically Hiding and Showing Tabs in a Tab Control Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI shows how to make a single tab control page visible and hide all other pages without the pages appearing grayed.

 
Description

When using the "Pages" property node to make the current tab invisible and show another tab, the current tab will be grayed-out until the user selects another tab, at which point it will disappear. This VI implements an event structure and a for loop to set the visibility property so that the newly visible tab is shown and the tab made invisible disappears immediately without being grayed-out or requiring user interaction.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Click the buttons on the front panel to make that tab control page visible and hide all other pages.
  2. Notice the behavior of the two tab controls. The first method will leave the current tab grayed-out until the user selects the newly-visible tab, while the second prevents that.

Additional Information or References
VI Snippet

003.png 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Caleb Harris

National Instruments | Mechanical Engineer | http://www.ni.com/support

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.