Skip to content

ComboBox.SelectedIndex

property · ComboBox · cAlgo.API

DesktopCLICloud

Set / Get the ComboBox selected item index

Environment behaviour

CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Definition

public int SelectedIndex {get; set;}
comboBox.SelectedIndex: int

Returns int

Examples

var comboBox = new ComboBox();
comboBox.AddItem("Hour");
comboBox.AddItem("Daily");
comboBox.SelectedIndex = 1;
Chart.AddControl(comboBox);
Print("Selected index: {0}, item: {1}", comboBox.SelectedIndex, comboBox.SelectedItem);
comboBox = ComboBox()
comboBox.AddItem("Hour")
comboBox.AddItem("Daily")
comboBox.SelectedIndex = 1
api.Chart.AddControl(comboBox)
api.Print(f"Selected index: {comboBox.SelectedIndex}, item: {comboBox.SelectedItem}")