AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Minimize on close?

Ein Thema von Razor · begonnen am 5. Aug 2007 · letzter Beitrag vom 5. Aug 2007
Antwort Antwort
Razor
(Gast)

n/a Beiträge
 
#1

Minimize on close?

  Alt 5. Aug 2007, 13:23
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
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.541 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
r2c2

Registriert seit: 9. Mai 2005
Ort: Nordbaden
925 Beiträge
 
#3

Re: Minimize on close?

  Alt 5. Aug 2007, 14:14
Just a hint(it has nothing to do with your problem, but can cause problems either):
if rzcheckbox10.Checked=true then This =true thing can be problematic as described here: http://r2c2.weingut-rehn.de/content5..._Variablen.htm

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
Kaum macht man's richtig, schon klappts!
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#4

Re: Minimize on close?

  Alt 5. Aug 2007, 14:30
I figured it out already thanks!

Delphi-Quellcode:
procedure TMainFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin

if rzcheckbox10.Checked=true then begin
canclose:=false;
TextTrayIcon1.hideMainForm;

    exit;



                    
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz