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

Dim instance As CheckedListBox Dim value As Boolean value = instance.CheckOnClick instance.CheckOnClick = value
/** @property */ public boolean get_CheckOnClick () /** @property */ public void set_CheckOnClick (boolean value)
すぐにチェック マークが適用される場合は true。それ以外の場合は false。既定値は false です。

CheckOnClick は、項目が選択されたときに、必ずチェック ボックスを切り替えるかどうかを示します。既定の動作では、クリックして選択項目を変更し、さらにもう一度クリックしてチェック マークを適用します。ただし、クリックと同時に項目もチェックされる方が良い場合もあります。

CheckOnClick プロパティ、SelectionMode プロパティ、および ThreeDCheckBoxes プロパティを設定して CheckedListBox コントロールを初期化するコード例を次に示します。このコードは、CheckedListBox にコントロールを読み込み、DisplayMember にコントロールの Control.Name プロパティを設定します。
この例を実行するには、CheckedListBox1 という名前の CheckedListBox オブジェクトが配置されているフォームに次のコードを貼り付けて、フォームのコンストラクタまたは Load メソッドから InitializeCheckListBox メソッドを呼び出します。
// This method initializes CheckedListBox1 with a list of all // the controls on the form. It sets the selection mode // to single selection and allows selection with a single click. // It adds itself to the list before adding itself to the form. internal System.Windows.Forms.CheckedListBox CheckedListBox1; private void InitializeCheckedListBox() { this.CheckedListBox1 = new CheckedListBox(); this.CheckedListBox1.Location = new System.Drawing.Point(40, 90); this.CheckedListBox1.CheckOnClick = true; this.CheckedListBox1.Name = "CheckedListBox1"; this.CheckedListBox1.Size = new System.Drawing.Size(120, 94); this.CheckedListBox1.TabIndex = 1; this.CheckedListBox1.SelectionMode = SelectionMode.One; this.CheckedListBox1.ThreeDCheckBoxes = true; foreach ( Control aControl in this.Controls ) { this.CheckedListBox1.Items.Add(aControl, false); } this.CheckedListBox1.DisplayMember = "Name"; this.CheckedListBox1.Items.Add(CheckedListBox1); this.Controls.Add(this.CheckedListBox1); }
// This method initializes CheckedListBox1 with a list of all // the controls on the form. It sets the selection mode // to single selection and allows selection with a single click. // It adds itself to the list before adding itself to the form. internal: System::Windows::Forms::CheckedListBox^ CheckedListBox1; private: void InitializeCheckedListBox() { this->CheckedListBox1 = gcnew CheckedListBox; this->CheckedListBox1->Location = System::Drawing::Point( 40, 90 ); this->CheckedListBox1->CheckOnClick = true; this->CheckedListBox1->Name = "CheckedListBox1"; this->CheckedListBox1->Size = System::Drawing::Size( 120, 94 ); this->CheckedListBox1->TabIndex = 1; this->CheckedListBox1->SelectionMode = SelectionMode::One; this->CheckedListBox1->ThreeDCheckBoxes = true; System::Collections::IEnumerator^ myEnum = this->Controls->GetEnumerator(); while ( myEnum->MoveNext() ) { Control^ aControl = safe_cast<Control^>(myEnum->Current); this->CheckedListBox1->Items->Add( aControl, false ); } this->CheckedListBox1->DisplayMember = "Name"; this->CheckedListBox1->Items->Add( CheckedListBox1 ); this->Controls->Add( this->CheckedListBox1 ); }

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に収録されているすべての辞書からCheckedListBox.CheckOnClick プロパティを検索する場合は、下記のリンクをクリックしてください。

- CheckedListBox.CheckOnClick プロパティのページへのリンク