Autor Beitrag
Memphis D
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Di 22.01.08 18:33 
Hi
also ich hab da nochmal ne Frage die mit der Checkbox zu tun hat und zwar:
Ich hab drei mal ne Checkbox und will, falls keine markiert wurde ne Showmessage ausgeben. Der Quelltext sieht so aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.btClick(Sender: TObject);
begin
IF NOT (CheckBox1.Checked) AND (CheckBox2.Checked) AND (CheckBox3.Checked) THEN
Showmessage('....')
ELSE 
....
end;


Leider kommt beim Anklicken des Buttons nichts, auch keine Fehlermeldung vom Delphi.
Woran liegt das denn?

MfG

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt


Zuletzt bearbeitet von Memphis D am Di 22.01.08 18:40, insgesamt 1-mal bearbeitet
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Di 22.01.08 18:36 
Dreimal CheckBox1 ? :P

:zwinker:

ausblenden Delphi-Quelltext
1:
If not (CheckBox1.Checked) and (CheckBox2.Checked) then //...					


EDIT:

Auch falsch :oops:, so:
ausblenden Delphi-Quelltext
1:
2:
IF NOT (CheckBox1.Checked) AND NOT (CheckBox2.Checked) AND NOT(CheckBox3.Checked) THEN
Showmessage('....')

_________________
Die Lösung ist nicht siebzehn.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 480

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 22.01.08 18:38 
Und vor den anderen sollte jeweils auch ein NOT kommen, oder so:
ausblenden Delphi-Quelltext
1:
if Not (CheckBox1.Checked OR CheckBox2.Checked OR CheckBox3.Checked) then ...					

_________________
We are, we were and will not be.
Memphis D Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Di 22.01.08 18:43 
Oh das mit der CheckBox1 war nen fehler sollte eigentlich Checkbox1, Checkbox2 .... heißen.
So ok funktioniert, das NOT hinter dem AND hat gefehlt.
Danke.