Example Code

Lock a Tab in a Tab Control in 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

Download All

Overview

This example shows how to the user can lock (disabled and greyed) a tab on the front panel

 

Description

This VI  uses a property node to return an array of pages within a tab control.  It then indexes a page out of the array and sets it to Disabled & Grayed.  The Lock/Unlock control on the front panel prompts the user for the password "engineer".  If password is correct the indexed page's status is reversed to either enabled or disabled & grayed depending on its current state.

 

Requirements

LabVIEW Full Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Run the VI
  2. Notice that Tab 2 is Disabled and Greyed out by default
  3. Click on Lock/Unlock button to change the enabled state
  4. Enter a selected password, in this case it is "engineer"
  5. Notice that Tab 2 has now switched states, from enabled to disabled or from disabled to enabled

 

 Additional Information or References

VI Block Diagram

4963.PNG

 

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

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner

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

Comments
surfnska
Member
Member
on

Perfect! I've been wanting to disable a tab for a while if a certain condition existed, but settled on disabling certain controls.

briguy68b
Member
Member
on

Hello, I am new to labview and am working on a program that a collegue made. I want to disable a tab when the user clicks the run button. I have looked at your example tryig to modify it to make it work for whaT I am trying to do but I am not knolewgable enough at this point to figure it out.

Jon_S.
NI Employee (retired)
on

You can use the Page Enabled property from above to disable and gray out a tab when your VI starts.  Just make it one of the first things that execute.

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner