Цитата(Uragan @ 11.8.2009, 01:34 ) | | Делал флаг и в CloseQuery проверял флаг но приходится еще раз жать на крестик |
Значит что-то не так делал.
Цитата(Frees @ 11.8.2009, 06:52 ) | | Application.Terminate; |
Frees, зачем так жестко?
Можно же вот так:
| Код | unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1; ccc:integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin ccc:=1; Close; end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if ccc=1 then CanClose:=true else begin CanClose:=false; Application.Minimize; end; end;
end.
|
|