SelectedIndex Property
- Namespace
TXTextControl.Windows. Forms. Ribbon
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesWindows. Forms. dll
Description
Gets or sets the index of the currently selected drop-down item. Setting -1 deselects the current selected drop-down item. If the RibbonListViewItemDropDown.ShowCheckMargin property is set to true, the corresponding item of the drop-down menu is checked when it is opened . If the RibbonListViewItemDropDown.ShowText property is set to true, setting this property updates the RibbonListViewItemDropDown.Text property with the text of the corresponding RibbonListViewItemDropDown.SelectedItem property value. The default value is -1.
Syntax
public int SelectedIndex { get; set; }Public Property SelectedIndex As IntegerExamples
The following example uses RibbonListViewItemDropDown.SelectedIndex to configure selected index as part of the ribbon list view item drop down workflow. The configured value is checked before the workflow continues.
ribbonListViewItemDropDown.SelectedIndex = 1;
Console.WriteLine($"Selected Index used by Ribbon List View Item Drop Down: {ribbonListViewItemDropDown.SelectedIndex}");ribbonListViewItemDropDown.SelectedIndex = 1
Console.WriteLine($"Selected Index used by Ribbon List View Item Drop Down: {ribbonListViewItemDropDown.SelectedIndex}")Remarks
A System.IndexOutOfRangeException is thrown if the set value is less than -1 or larger than or equals to the number of drop-down items.