Sign in Join
Wiki copytemporary

TRadioGroup/de

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

Diese Seite erklärt, wie man die TRadioGroup Komponente verwendet. Auf etwas klicken bedeutet immer ein Linksklick, ein Rechtsklick wird explizit erwähnt.

Beschreibung

Eine Gruppe RadioButtons, aus dieser der Benutzer eine Auswahl treffen kann. Die Komponente ist wie eine TGroupBox mit integrierten TRadioButtons.

Verwendung

Um eine TRadioGroup auf einem Formular zu nutzen, kann man sie einfach auf der Komponentenpalette Standard auswählen und, mit einem Klick auf das Formular, platzieren.\

Kleines Beispiel

Es sollen geometrische Figuren zufällig und in Abhängigkeit der TRadioGroups auf das Formular gezeichnet werden. RadioGroup1 bestimmt die Form, RadioGroup2 die Anzahl.

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;

Siehe auch


From the Free Pascal wiki, page "TRadioGroup/de", as it stood on 2020-03-01 after a change by Trev, 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 3 people, 2014–2020

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
MichlCreated page
Michladded Verwendung
Michl (minor)
MichlKleines Beispiel (minor)
MathiasKleines Beispiel (minor)
TrevFixed syntax highlighting; deleted category included in page template (minor)

Talk about this page

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