다음을 통해 공유


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

속성 값

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

예제

이 예제에서는 사용자가 선택하기 전에 속성을 사용하여 텍스트를 TextBox 설정하는 방법을 Text 보여 줍니다.

<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이 속성을 설정하면 입력란에 입력된 초기 텍스트가 배치됩니다. 이 IsEditable 경우 false이 값을 설정해도 아무런 효과가 없습니다.

종속성 속성 정보

Item 가치
식별자 필드 TextProperty
메타데이터 속성이 다음으로 설정됩니다. true BindsTwoWayByDefault, Journal

적용 대상