![]() |
Minimize on close?
How can i minimize on close?
procedure TMainFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if rzcheckbox10.Checked=true then canclose:=false; if mainfrm.CloseQuery=true then TextTrayIcon1.HideMainForm; end; This wont work |
Re: Minimize on close?
Do you want to minimize or to hide your form? Here' s an example for hiding:
Delphi-Quellcode:
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).
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin if CheckBox1.Checked then begin Action := caNone; self.Hide; end; end; |
Re: Minimize on close?
Just a hint(it has nothing to do with your problem, but can cause problems either):
Delphi-Quellcode:
This =true thing can be problematic as described here:
if rzcheckbox10.Checked=true then
![]() I don't know, if you can spek German, so here in short: - An bool variable is a bool expession itself. So it's not necessary to put ae =true there - because of the different binary representations of bool vars, it can cause problems, when you use WinAPI functions or interact with other apps //Edit: Using delphi-tags makes it easier to read code... So just use those funny buttons in the posting-editor... thx regards Christian |
Re: Minimize on close?
I figured it out already thanks! :-D
Delphi-Quellcode:
procedure TMainFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin if rzcheckbox10.Checked=true then begin canclose:=false; TextTrayIcon1.hideMainForm; exit; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:55 Uhr. |
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