From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Add Custom Symbol to Tree Control

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

The example demonstrates how to add an image as a symbol to a tree control.

 

Description

The example demonstrates how to programmatically add a custom symbol to a tree control.  It also shows to optional steps of resetting the tree control's array of symbols to the default built in symbols as well as retrieving the custom symbols from the array and displaying the symbol.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Run the VI
  3. Select the desired Symbol Image
  4. Click 'Add' to add the symbol with the Left Cell String and the Child Text to the Tree control
  5. Click 'Get Symbol Picture' to display the Symbol Picture in full resolution

 

Additional Information or References

Add Item to Tree with custom Symbol - Front Panel.png

 

Add Item to Tree with custom Symbol - Block Diagram.png

 

Knowledgebase: How Do I Load and Use Custom Symbols for My Tree Control Items?
http://digital.ni.com/public.nsf/allkb/89A75D98771F2FB686256F350055EB3A?OpenDocument

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

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

Comments
kosist90
Active Participant
Active Participant
on

That link from the post - http://digital.ni.com/public.nsf/allkb/89A75D98771F2FB686256F350055EB3A?OpenDocument - is not working anymore...