ComboBox.SelectionBoxItem Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the item that is displayed in the selection box.
public:
property System::Object ^ SelectionBoxItem { System::Object ^ get(); };
public object SelectionBoxItem { get; }
member this.SelectionBoxItem : obj
Public ReadOnly Property SelectionBoxItem As Object
The selected item.
The following example binds the Content property of a ContentPresenter to the SelectionBoxItem property. The ContentPresenter is part of the ControlTemplate for the ComboBox.
For a complete sample, see Styling with ControlTemplates Sample.
<ContentPresenter x:Name="ContentSite"
IsHitTestVisible="False"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
Margin="3,3,23,3"
VerticalAlignment="Stretch"
HorizontalAlignment="Left">
</ContentPresenter>
The ControlTemplate of the ComboBox uses this property to show the selected item in the ComboBox. To get the selected item of the ComboBox outside of the ControlTemplate, use the Selector.SelectedItem property instead of this property.
<object property="{TemplateBinding SelectionBoxItem}"/>
Item | Value |
---|---|
Identifier field | SelectionBoxItemProperty |
Metadata properties set to true |
None |
Produto | Versões |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: