Example Code

Programmatically Set Scroll Bar Position in a Multicolumn Listbox

The scroll bar position in the Multicolumn Listbox is set by using the property node Top Left Visible Cell. The following steps outline the process for creating this property node.


  1. Place a Mulitcolumn Listbox VI on the Block Diagram.
  2. Right-click the Multicolumn Listbox Vi and select Create»Property Node»TopRow Left Visible Cell. ("TopRow" for single Column Listbox)
  3. Right-click the Property Node and select Change to Write from the shortcut menu.
  4. Right-click the Property Node and select Create»Constant from the shortcut menu.
  5. In the cluster constant that appears, enter cell coordinates for the desired top left position, as shown in Figure 1.

    Note: The top element correlates to the row, while the bottom element correlates to the column.

Menu.jpg

Figure 1: Block Diagram and Front Panel example of Multicolumn Listbox and Property Node.

  1. Run the vi. The propery node will programmatically set the position of the Multicolumn Listbox to the position set by the Top Left Visible Cell property node.

Refer to the LabVIEW Help, which you can access by selecting Help»Contents and Index, for more information about individual properties and valid values.

Customer Education Product Marketing Manager
National Instruments

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

Comments
CMal
Active Participant
Active Participant
on

Image attachment is missing.

Contributors