Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Case RadioGroup of [Gelöst] (https://www.delphipraxis.net/41326-case-radiogroup-%5Bgeloest%5D.html)

Skyrunner2 1. Mär 2005 17:45


Case RadioGroup of [Gelöst]
 
Ist es möglich die auswahl in einer Radiogroup via case stement zuerkennen, oder müssen das mehrere IF schleifen sein?

also so etwas wie:

case RadioGroup1.Selected of
RadioButton1: [...]
RadioButton2: [...]
RadioButton3: [...]
end;

oder geht das nur so:

if RadioButton1.checked then
else if RadioButton2.checked then
else if RadioButton3.checked then

....

?


__________________________

RadioGroup.Items festlegen (und nicht RadioButtons hinzufügen)
dann via RadioGroup.ItemIndex abfagen welcher "checked" ist

Matze 1. Mär 2005 17:54

Re: Case RadioGroup of
 
Delphi-Quellcode:
case RadioGroup1.ItemIndex of
  0: Color := clRed;
  1: Color := clGreen;
  2: Color := clBlue;
end;
Das sollte gehen.

Nachtrag: Das 'Color' war nur für mich zum Testen ;)
Nachtrrag 2: Tippfehler korrigiert

Skyrunner2 1. Mär 2005 17:57

Re: Case RadioGroup of [Gelöst]
 
hehe zur selben zeit gepostet...

habs gelöst.. trozdem danke


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz