Sign in Join
Wiki copytemporary

TCheckGroup/ja

Deutsch · English · Français · Suomi · Русский · 中文(中国) · 日本語

TCheckGroupは、コンテナコンポーネント上で物理的におよび論理的にグループ化されたTCheckBoxアイテムのグループを含むコントロールである。

TForm上でTCheckGroupを使用するには、単にコンポーネントパレットのStandardタブでそれを選択し、フォーム上でクリックして配置する。

例

フォームの背景色を変更する。この色は、個々の色成分を加算して決定される:

pascal
procedure TForm1.cgRedItemClick(Sender: TObject; Index: integer);
var
  i, c: Integer;
begin
  c := $000000;                                          // first the color is black
  for i:=0 to 7 do begin                                 // test Items 0..7 of all Checkgroups
    if cgRed.Checked[i]   then c := c + 1 shl i;         // amount of red   $000000..$0000FF
    if cgGreen.Checked[i] then c := c + 1 shl (i + 8);   // amount of green $000000..$00FF00
    if cgBlue.Checked[i]  then c := c + 1 shl (i + 16);  // amount of blue  $000000..$FF0000
  end;
  Color := c;
end;

チェックボックスにアクセスする

TCheckGroup内の各アイテムにはCheckedプロパティがあり、それらをすべてチェック済みに設定するには、次のようにする。

pascal
for i := 0 to MyCheckGroup.items.Count-1 do   // 見つかったすべてのカテゴリを調べる
    MyCheckGroup.Checked[i] := true;

実行時にアイテムを追加するには、TCheckGroup.Itemsを使用する。これはTStringsリストである。新しいチェックボックスをセットに追加するには、単にMyCheckGroup.Items.add('CheckThis');を行う。同様に、すべてのアイテムを削除するには、リストをクリアする MyCheckGroup.Items.clear;

以下も参照のこと


From the Free Pascal wiki, page "TCheckGroup/ja", as it stood on 2024-03-24 after a change by Ariben, out of the wiki's dump of 2024-05-26. 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.

Revision 2, last changed by WikiArchive .

Edited on wiki.freepascal.org by 1 person, 2024

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
AribenCreated page
AribenSee also
AribenSee also
Ariben
Ariben
AribenUsage
AribenAccessing the Check Boxes
AribenSee also
Ariben以下も参照のこと

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.