共用方式為


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)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Property SelectedItem As RibbonDropDownItem
[BrowsableAttribute(false)]
RibbonDropDownItem SelectedItem { get; set; }

Property Value

Type: Microsoft.Office.Tools.Ribbon.RibbonDropDownItem
The RibbonDropDownItem that is currently selected.

Remarks

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 nulla null reference (Nothing in Visual Basic). By default, this property refers to the first item in the Items collection.

.NET Framework Security

See Also

Reference

RibbonDropDown Interface

Microsoft.Office.Tools.Ribbon Namespace

Other Resources

Ribbon Object Model Overview