Autor Beitrag
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 17.12.02 15:36 
hi,

hab hier ein PageControl nun will ich diese wenn der beenden button geklickt wurde einzeln schliessen. nun die frage wie schliesse ich diese eine nach der anderen bei der ersten angefangen bis zur letzten oder anders herum das ist egal :)


gr€€tz
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Di 17.12.02 15:49 
Hallo,

etwa so:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormClose(Sender:TObject; var Action:TCloseAction);
var i:Integer;
begin
  with PageControl1 do for i:=0 to PageCount-1 do Pages[i].Free;
  Action:=caFree,
end;


Apropos: In Delphi ist eine umfangreiche Hilfe integriert. Wie ich schon einmal sagte, es würde nichts schaden, dort erst einmal nachzuschauen.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Luncustaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 17.12.02 15:55 
hi,

danke ersmal.

ich hab in der hilfe geschaut hab aber eher unter Close nachgesehen und nicht nach free sorry.


gr€€tz
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Di 17.12.02 15:57 
Hi
jemand der andere so oft auf die umfangreiche Hilfe hinweist, sollte eigentlich wissen, dass das so nicht funktioniert, sondern so rum:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.FormClose(Sender:TObject; var Action:TCloseAction); 
var i:Integer; 
begin 
  with PageControl1 do 
    for i:= PageCount-1 downto 0 do 
      Pages[i].Free; 
  Action:=caFree, 
end;


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Di 17.12.02 16:10 
Hallo,

@LCS
Das hat mit dem Hinweis auf die Hilfe nichts zu tun. Da ich meine Antwort immer on the fly hinschreibe, kann es durchaus vorkommen, das sich mal der eine oder andere Fehler einschleicht.

@Luncustaf
Alle mit Create erzeugten Objekt, werden normalerweise mit Free wieder zerstört. Ausnahmen von dieser Regel gibt es natürlich auch.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Luncustaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 17.12.02 16:14 
smiegel hat folgendes geschrieben:

@Luncustaf
Alle mit Create erzeugten Objekt, werden normalerweise mit Free wieder zerstört. Ausnahmen von dieser Regel gibt es natürlich auch.



und wieder was gelernt :) hmm wird immer besser hier thx für deine in letzten tagen große hilfe.

gr€€tz
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Di 17.12.02 16:15 
@smiegel
Du hast Recht. Es hat nichts mit der Hilfe sondern mit dem Tonfall in dem du hier antwortest du tun.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...