RibbonDropDown.SelectedItem Property

 

Gets or sets the RibbonDropDownItem that is currently selected.

Namespace:   Microsoft.Office.Tools.Ribbon
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

[BrowsableAttribute(false)]
RibbonDropDownItem SelectedItem { get; set; }

Property Value

Type: Microsoft.Office.Tools.Ribbon.RibbonDropDownItem

The RibbonDropDownItem that is currently selected.

Setting this property to a RibbonDropDownItem causes the item to appear in the text box portion of the drop-down list. The RibbonDropDownItem reference that you assign to the SelectedItem property must exist in this RibbonDropDown object's Items collection. Otherwise, an ArgumentException will be thrown.

Assigning a new value to the SelectedItem property does not cause a SelectionChanged event to be raised.

If the Items collection is not empty, then this property is not null. By default, this property refers to the first item in the Items collection.

Return to top
Show: