Delphi-PRAXiS
Seite 3 von 3     123   

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 Boolean ändert nicht seinen Wert (?) (https://www.delphipraxis.net/74204-boolean-aendert-nicht-seinen-wert.html)

DGL-luke 30. Jul 2006 15:35

Re: Boolean ändert nicht seinen Wert (?)
 
Dass die Variable auf True steht ist jedenfalls weit wahrscheinlicher, immerhin gilt 0 = false und alles andere = true...

Prototypjack 30. Jul 2006 15:58

Re: Boolean ändert nicht seinen Wert (?)
 
Hallo,
Auch auf die Gefahr hin, dass mein Beitrag komplett überflüssig ist, versuch's mal so(Damit löst sich das Problem der Initialisierung):
Delphi-Quellcode:
procedure SomeButtonClick(Sender: TObject);
begin
  FadeOutOnClose := not FadeOutOnClose; // = FOOC
  if FadeOutOnClose then
  begin
     xiFadeOutOnClose.Caption := 'Deactivate fade out on close';
  end
  else
  begin
     xiFadeOutOnClose.Caption := 'Activate fade out on close';
  end;
end;
Delphi-Quellcode:
procedure CustomFormCreate(Sender: TObject);
begin
  FadeOutOnClose := False;
  SomeButtonClick(Self);
  // Hier wird der negative Wert des FadeOutOnClose Booleans initialisiert.
  // Das heisst, setzt du hier FadeOutOnClose auf False steht auf dem Button 'Deactivate fade out on close'
  // Der Button sollte jetzt vorhersehbar reagieren
end;
Gruß,
Max


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:36 Uhr.
Seite 3 von 3     123   

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