TextBoxBase.HideSelection 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤이 포커스를 잃을 때 텍스트 상자 컨트롤에서 선택한 텍스트가 강조 표시되어 있는지 여부를 나타내는 값을 가져오거나 설정합니다.
public:
property bool HideSelection { bool get(); void set(bool value); };
public bool HideSelection { get; set; }
member this.HideSelection : bool with get, set
Public Property HideSelection As Boolean
속성 값
true 텍스트 상자 컨트롤이 포커스를 잃을 때 선택한 텍스트가 강조 표시되지 않으면 이고, false은 텍스트 상자 컨트롤에 포커스가 끊어질 때 선택한 텍스트가 강조 표시된 상태로 유지되면 입니다. 기본값은 true입니다.
예제
다음 코드 예제에서는 속성을 사용 하는 방법을 보여 줍니다 HideSelection . 예제를 실행하려면 다음 코드를 양식에 붙여넣습니다. 폼의 InitializeTextBox 생성자 또는 Load 메서드에서 메서드를 호출합니다.
//Declare a textbox called TextBox1.
internal:
System::Windows::Forms::TextBox^ TextBox1;
private:
//Initialize TextBox1.
void InitializeTextBox()
{
this->TextBox1 = gcnew TextBox;
this->TextBox1->Location = System::Drawing::Point( 32, 24 );
this->TextBox1->Name = "TextBox1";
this->TextBox1->Size = System::Drawing::Size( 136, 20 );
this->TextBox1->TabIndex = 1;
this->TextBox1->Text = "Type and hit enter here...";
//Keep the selection highlighted, even after textbox loses focus.
TextBox1->HideSelection = false;
this->Controls->Add( TextBox1 );
}
//Declare a textbox called TextBox1.
internal System.Windows.Forms.TextBox TextBox1;
//Initialize TextBox1.
private void InitializeTextBox()
{
this.TextBox1 = new TextBox();
this.TextBox1.Location = new System.Drawing.Point(32, 24);
this.TextBox1.Name = "TextBox1";
this.TextBox1.Size = new System.Drawing.Size(136, 20);
this.TextBox1.TabIndex = 1;
this.TextBox1.Text = "Type and hit enter here...";
//Keep the selection highlighted, even after textbox loses focus.
TextBox1.HideSelection = false;
this.Controls.Add(TextBox1);
}
'Declare a textbox called TextBox1.
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
'Initialize TextBox1.
Private Sub InitializeTextBox()
Me.TextBox1 = New TextBox
Me.TextBox1.Location = New System.Drawing.Point(32, 24)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(136, 20)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = "Type and hit enter here..."
'Keep the selection highlighted, even after textbox loses focus.
TextBox1.HideSelection = False
Me.Controls.Add(TextBox1)
End Sub
설명
이 속성을 사용하면 텍스트 상자 컨트롤에 텍스트가 강조 표시되고 다른 폼이나 대화 상자에 맞춤법 검사기 대화 상자와 같은 포커스가 있는 상태로 유지할 수 있습니다.