ComboBox.Text Property
Definition
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 or sets the text of the currently selected item.
public:
property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
public string Text { get; set; }
member this.Text : string with get, set
Public Property Text As String
Property Value
The string of the currently selected item. The default is an empty string ("").
Examples
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>
Remarks
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.
Dependency Property Information
Identifier field | TextProperty |
Metadata properties set to true |
BindsTwoWayByDefault, Journal |
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET