Autor Beitrag
ralfi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 153



BeitragVerfasst: So 27.07.03 20:45 
Hallo!

Wie kann ich das normale Schließen eines Formulars verhindern?
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: So 27.07.03 20:48 
Ich glaube, daß geht nur, wenn du das CloseQuery-Ereignis aufrufst. Dort wird, glaube ich, eine Variable names "CanClose" vom Typ Boolean mitgebracht und die mußt du auf False setzen, soviel ich weiß.

Wenn du das gemacht hast, sollte das Programm nicht zu schließen sein aber am Besten ist es, wenn du hier im Forum nochmal nach

Suche in: Delphi-Forum, Delphi-Library CANCLOSE

suchst..

_________________
Hasta La Victoria Siempre
Guardian of R'lyeh
Hält's aus hier
Beiträge: 14

Windows9x, WindowsXP
D7 Prof
BeitragVerfasst: Mo 28.07.03 16:02 
nene, das ist schon genau die richtige Lösung mit dem OnCloseQuery und der Variable CanClose.

zum Beispiel:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm_Main.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
   if MessageDlg('Wirklich beenden?', mtConfirmation, [mbYes, mbNo], 0) = mrNo then
   begin
      CanClose := FALSE;
   end
   else CanClose := TRUE;
end;