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



BeitragVerfasst: Mi 16.01.08 21:10 
Hi
hab da noch eine Problem und zwar mit'ner Checkbox:
Wollte das so programmieren das, wenn ich nen Button anklicke undie Checkbox nicht markiert is ne Showmessage kommt. So nun klappt das aber nich so wie ich gedacht hatte.
Kann mir jemand nen Tip geben?

Beispiel:

procedure TForm1.btClick(Sender: TObject);
begin
IF checkbox.Checked:=False THEN
Showmessage;
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Mi 16.01.08 21:21 
:= ist der Zuweisungsoperator, der hier fehl am Platze ist.
Du brauchst den Vergleichsoperator =

Also:
ausblenden Delphi-Quelltext
1:
2:
If Checkbox.Checked = False Then
Showmessage(...);


Alternativ kannst du auch einfach If not Checkbox.Checked Then schreiben.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 16.01.08 21:25 
user profile iconnagel hat folgendes geschrieben:
Alternativ kannst du auch einfach If not Checkbox.Checked Then schreiben.
Nicht alternativ, das sollte man auf jeden Fall so machen. ;-)

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



BeitragVerfasst: Mi 16.01.08 21:25 
Vielen Dank für die schnelle Antwort.