Revision 1 of 1, by WikiArchive on 11-10-2026. The page as it is now.
TCheckListBox/ja
A TCheckListBox
はユーザーが複数の選択ができる(スクロールできる)チェックボックスのコンポーネントである。Component PaletteのAdditional tabにある。
使い方
TCheckListBoxは2つの部品からなってると考えること。左にチェックボックスを持つ、文字の入ったTListBoxである。この文字列は通常チェックボックスを選択するとユーザーが選択したものを現す。文字列はここに用いられるように配置され、例えば -
CheckListBox1.AddItem('Line One', Nil);
CheckListBox1.AddItem('Line Two', Nil);または、すでに存在する文字列のリストのどこでも割り当てること -
CheckListBox1.Items.Assign(MyStringList);そこで、わかる状態にチェックボックスを配置するのは良い考えで -
for I := 0 to CheckListBox1.Count-1 do
CheckListBox1.Checked[I] := False;TCheckListBoxはユーザに好みの数だけ、あるいはまったく選択しないことを可能にする。0個の選択許すためにOnItemClickイベントを用い -
procedure TNoteBookPick.CheckListBox1ItemClick(Sender: TObject; Index: integer);
var
I : integer;
begin
if (Sender as TCheckListBox).Checked[Index] then begin
for I := 0 to CheckListBox1.Count -1 do
CheckListBox1.Checked[I] := False;
CheckListBox1.Checked[Index] := True;
end;
end;例えばユーザーがチェックボックスを埋め終わったことを読み取るのに -
for I := 0 to CheckListBox1.Count -1 do
if CheckListBox1.Checked[I] then DebugLn('Checked Item ' + CheckListBox1.Items[I]);TCheckGroupとの比較
Standard component paletteタブに類似した名前のTCheckGroupがある。違いは
- TCheckGroupのアイテムは等幅になっているが、TCheckListBoxは下にスクロールできる。
- TCheckListBox はAllowGrayedプロパティを持つ
以下も参照のこと
From the Free Pascal wiki, page "TCheckListBox/ja", as the Internet Archive kept it on 2025-01-17, last changed on 2024-09-23. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

