Main Content

getSelectedItems

Class: Simulink.dialog.ListboxControl
Namespace: Simulink.dialog

Get the values of selected items from a list box

Syntax

getItems = listboxControl.getSelectedItems

Description

getItems = listboxControl.getSelectedItems gets the information of the selected items from the list box.

Output Arguments

expand all

Value of the selected items, returned as a cell array.

Examples

% Get block mask handle
maskObj = Simulink.Mask.get(gcb); 

% Get listbox handle
listboxControl = maskObj.getDialogControl('Control2');

% Get selected items
getItems = listboxControl.getSelectedItems; 

getItems = 
  1×2 cell array
  {'Hello', 'World'}

Version History

Introduced in R2019a