ComboBox.Text 속성

정의

현재 선택된 항목의 텍스트를 가져오거나 설정합니다.

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

속성 값

String

현재 선택된 항목의 문자열입니다. 기본값은 빈 문자열("")입니다.

예제

이 예제에서는 하는 방법을 Text 텍스트를 설정 하려면 속성을 사용할 수 있습니다는 TextBox 전에 사용자가 항목을 선택 합니다.

<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>

설명

경우는 IsEditable 속성은 true, 텍스트 상자에 입력 한 초기 텍스트가이 속성을 설정 합니다. 때 IsEditablefalse,이 값을 설정 해도 효과가 없습니다.

종속성 속성 정보

식별자 필드 TextProperty
메타 데이터 속성 설정 true BindsTwoWayByDefault, Journal

적용 대상