TextBoxBase.HideSelection プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As TextBoxBase Dim value As Boolean value = instance.HideSelection instance.HideSelection = value
/** @property */ public boolean get_HideSelection () /** @property */ public void set_HideSelection (boolean value)
テキスト ボックス コントロールがフォーカスを失ったときに、選択されているテキストが強調表示されない場合は true。テキスト ボックス コントロールがフォーカスを失っても、選択されているテキストが強調表示されたままである場合は false。既定値は true です。

このプロパティを使用すると、スペル チェックのダイアログ ボックスなどのダイアログ ボックスやほかのフォームにフォーカスが移動する間に、テキスト ボックス コントロールのテキストを強調表示しておくことができます。

HideSelection プロパティを使用する方法を次のコード例に示します。この例を実行するには、次のコードをフォームに貼り付けます。そして、フォームのコンストラクタまたは Load メソッドで InitializeTextBox メソッドを呼び出します。
'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
//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. 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. System.Windows.Forms.TextBox textBox1; //Initialize TextBox1. private void InitializeTextBox() { this.textBox1 = new TextBox(); this.textBox1.set_Location(new System.Drawing.Point(32, 24)); this.textBox1.set_Name("TextBox1"); this.textBox1.set_Size(new System.Drawing.Size(136, 20)); this.textBox1.set_TabIndex(1); this.textBox1.set_Text("Type and hit enter here..."); //Keep the selection highlighted, even after textbox loses focus. textBox1.set_HideSelection(false); this.get_Controls().Add(textBox1); } //InitializeTextBox

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTextBoxBase.HideSelection プロパティを検索する場合は、下記のリンクをクリックしてください。

- TextBoxBase.HideSelection プロパティのページへのリンク