ウィキのコピーミラー

これは pascal.chat のウィキのミラーです。編集、履歴、ログインはそちらで行います。

TRadioGroup/ja

Deutsch · English · Français · Suomi · Русский · 日本語

TRadioGroupは、関連するが相互に排他的なTRadioButtonのグループであり、ユーザーに対して選択肢の1つを選択する必要がある。それは、統合されたTRadioButtonsを持つTGroupBoxのようなものである。

使い方

FormでTRadioGroupを使用するには、単純にComponentパレットのStandardタブでそれを選択し、フォームをクリックして配置します。

例

ジオメトリック図形は、TRadioGroupによってフォームにランダムに描画され、表示される。最初のRadioGroupは図形を決定し、2番目のRadioGroupは個数を決定する。

pascal
procedure TForm1.rgShapeClick(Sender: TObject);
begin
  Repaint;
end;
pascal
procedure TForm1.FormPaint(Sender: TObject);
var
  i: Integer;
begin
  if TryStrToInt(rgCount.Items[rgCount.ItemIndex], i) then
    for i:=1 to i do begin
      Canvas.Pen.Color:=Random($1000000);
      Canvas.Brush.Color:=Random($1000000);
      case rgShape.Items[rgShape.ItemIndex] of
        'Lines':      Canvas.Line(Random(ClientWidth), Random(ClientHeight), Random(ClientWidth), Random(ClientHeight));
        'Rectangles': Canvas.Rectangle(Random(ClientWidth), Random(ClientHeight), Random(ClientWidth), Random(ClientHeight));
        'Ellipses':   Canvas.Ellipse(Random(ClientWidth), Random(ClientHeight), Random(ClientWidth), Random(ClientHeight));
      end;
    end;
end;

以下も参照のこと


From the Free Pascal wiki, page "TRadioGroup/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.

第2版、最終更新:WikiArchive 。