Creating a Multicolumn Listbox Control

Use a multicolumn listbox control in LabVIEW to display selectable items on the front panel along with metadata about those items. Use a Case Structure on the block diagram to create code that handles selections in the listbox.

Use a multicolumn listbox instead of a standard listbox if you need to give users additional information about the selection items in a table-style format.

To create a multicolumn listbox, complete the following steps.

  1. Add a multicolumn listbox control to the front panel window from Controls » Style » List, Table & Tree » Multicolumn Listbox.
  2. Add a listbox item: use the Labeling tool to type in a cell in the leftmost column and press the Enter key.
  3. Add information for users about the item: type in the cells in the same row.
  4. Repeat steps 2 and 3 for each item you want to enter in the listbox.
  5. Optional: Set the number of items a user can select in the multicolumn listbox.
  6. Optional: Add symbols to the items in the listbox.
    In a multicolumn listbox, LabVIEW adds the symbol to the first column.
  7. Optional: Change the color of the symbols and the color of the headers and cells.
  8. Create a Case Structure on the block diagram to handle the selected item with conditional code for each item.

    How a listbox control behaves on the block diagram depends on the selection mode for the listbox.

    Selection ModeBlock Diagram Behavior
    0 or 1 Item or 1 Item Listbox control appears as a 32-bit signed integer.

    The data value for a single-selection listbox is a number that represents the currently selected option. The first item in the list has a value of zero. If no item is selected, the value is –1.

    0 or More Items or 1 or More Items Listbox control appears as an array of 32-bit signed integers.

    The value(s) in the array represent the currently selected item(s). If no item is selected, the value is an empty array.

You can configure multicolumn listboxes further: