Autor Beitrag
delphineuling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 14:21 
ich habe jetzt in mein programm radiobuttons eringebaut und will jetzt das wenn keiner der drei gechecked ist eine nachricht angezeigt wird.
habs soweit hinbekommen das wenn ich einen hab der eine nachricht anzeigt wenn er gechecked ist aber nicht wenn ich mehrere hab und er soll das ja anzeigen wenn er nicht gechecked ist.

so habe ich es wie oben beschrieben nur hinbekommen

im on click der buttons

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
if radiobutton1.checked then showmessage ('GUT')
else if 
radiobutton2.checked then showmessage ('richtig')
else if 
radibutton3.checked then showmessage ('ok')
end;


ist das so richtig?
und was muss anstelle von checked hin wenn er das anzeigen soll wenn das nicht gechecked ist?

Moderiert von user profile iconAXMD: Delphi-Tags hinzugefügt
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Do 16.03.06 14:28 
ausblenden Delphi-Quelltext
1:
2:
if (radiobutton1.Checked = false) and (radiobutton2.Checked = false) and (radiobutton3.Checked = false)
 then showmessage('Bitte wählen sie eine Option aus!');


hoffe habe dich richtig verstanden :roll:
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 16:20 
jo ok funktionier hatte ähnliches auch mal mit or versucht bin irgendwie net auf and gekommen
danke
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 18.03.06 13:57 
Geht noch bissl kürzer:
ausblenden Delphi-Quelltext
1:
2:
if (not (Radiobutton1.Checked) AND (not Radiobutton2.Checked) AND (not Radiobutton3.Checked) then
  ShowMessage('Bitte wählen sie eine Option aus!');

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)