Autor Beitrag
JaketheSnake
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 149

XP
D5 Prof.
BeitragVerfasst: Mo 31.10.05 16:16 
Wie kann man verhindern, dass das Programm schließt, wenn man auf das x ganz rechts oben eines projects drückt ?


Moderiert von user profile iconAXMD: Topic aus Sonstiges verschoben am Mi 02.11.2005 um 14:52

_________________
Good, better , best


Zuletzt bearbeitet von JaketheSnake am Mo 31.10.05 16:30, insgesamt 2-mal bearbeitet
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mo 31.10.05 16:18 
Du hast glaub nen Fehler in deinem Satz: "Wie kann man verhindern, dass das Programm nicht schließt" ;)
Ich denk das was du suchst, solltest du im Event "OnCanClose" von deiner Form finden :)



MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mo 31.10.05 16:22 
Machst du mit dem OnClose deiner Form und guckst du in der DelphiHilfe unter TCloseAction. :wink:
JaketheSnake Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 149

XP
D5 Prof.
BeitragVerfasst: Mo 31.10.05 16:24 
Danke für die Verbesserung , ich hoffe der Satz ist jetzt richtig :lol:

Ich benutze Delphi5 und finde bei mir nur onClose unter Ereignisse :gruebel:

_________________
Good, better , best
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mo 31.10.05 16:27 
Nee, so passt der satz logisch immer noch nciht ;) weil wenn ich verhindere dass das programm nicht schließt, schließt sich das programm ja :)

Tut mir leid, ich hab mich im Event geirrt :oops: das heißt OnCloseQuery :)

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mo 31.10.05 16:31 
Ja mit OnCloseQuery gehts auch. :lol:
Aber welches ist besser? :gruebel:
JaketheSnake Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 149

XP
D5 Prof.
BeitragVerfasst: Mo 31.10.05 16:42 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);

begin
  if MessageDlg('Anwendung schließen?', mtConfirmation,
    [mbYes, mbNo], 0) = mrYes then
    Action := caNone
  else
    Action := caNone;
end;


Soweit bin ich gekommen . Es passiert jetzt gar nichts wenn man auf beenden clickt.
Mein problem ist jetzt wie schalte ich es wieder aus ?

_________________
Good, better , best
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mo 31.10.05 17:01 
Der Dialog ist etwas Sinnlos. Es reicht wenn du nur das schreibst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caNone;
end;


Um es zur Laufzeit ein- und auszuschalten mach dir eine globale Variable die du vorher Abfragst.
z.b
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
...

var
  Schliesen: Boolean;

...

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if Schliesen then
    Action := caNone;
end;


"if Schliesen then" und "if Schliesen = true then" ist das gleiche. :wink: