ComboBox::Text Property
.NET Framework (current version)
Gets or sets the text of the currently selected item.
Assembly: PresentationFramework (in PresentationFramework.dll)
Property Value
Type: System::String^The string of the currently selected item. The default is an empty string ("").
When the IsEditable property is true, setting this property places initial text entered in the text box. When IsEditable is false, setting this value has no effect.
Identifier field | |
Metadata properties set to true |
This example shows how the Text property can be used to set text into the TextBox before the user makes a selection.
<ComboBox Name="cb" Margin="10,10,3,3" Width="200" Height="30" Grid.Column="0" Grid.Row="2" ItemsSource="{StaticResource myCities}" Text="My Cities" IsEditable="true" IsReadOnly="true" IsDropDownOpen="True" StaysOpenOnEdit="True"> </ComboBox>
.NET Framework
Available since 3.0
Available since 3.0
Show: