Thema: Delphi Minimize on close?

Einzelnen Beitrag anzeigen

Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.542 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: Minimize on close?

  Alt 5. Aug 2007, 13:43
Do you want to minimize or to hide your form? Here' s an example for hiding:
Delphi-Quellcode:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if CheckBox1.Checked then
    begin
      Action := caNone;
      self.Hide;
    end;
end;
But beware that your form is not visible anymore so that the user cannot close it anytime. For this be sure to give him the possibility to reach your application (e.g. by a hotkey or an icon in the TNA).
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat