Forum Replies Created
-
AuthorPosts
-
pholon
Participantthis is the unite
pholon
Participantyes, I want to have a procedure for a pages closing. and when closing, calling OnCloseBtnClose
pholon
Participantthere is a menuitem with caption “CloseAllTabSheets” in mainmenu.
if this menuitem clicked then calling the method :
//code
procedure OnCloseAllTabsheets;
begin
while sPageControl1.PageCount 0 do
begin
sPageControl1.ActivePageIndex := 0;
try
sPageControl1.CloseActivePage; //!!!!!!! need this method or : sPageControl1.ClosePage(aPageIndex : Integer);
if iPageCount = sPageControl1.PageCount then //close error
Break;
except
on E : Exception do
begin
MessageBox(Handle, Pchar(E.Message), 'OK', MB_OK);
Break;
end;
end;
end;
end;
//code
thanks!
pholon
ParticipantsPageControl.pas
procedure TsPageControl.WndProc(var Message: TMessage);
WM_LBUTTONUP, WM_LBUTTONDOWN:
if Assigned(OnCloseBtnClick) then OnCloseBtnClick(Self, i, b, Act);
and
procedure TsPageControl.CloseClick(Sender: TObject);
if Assigned(OnCloseBtnClick) then OnCloseBtnClick(Self, TsTabBtn(Sender).Page.TabIndex, ToClose, Act);
OnCloseBtnClose Renamed OnClosePage, More appropriate.
if you add a method closePage(iIndex : Integer) to closing the, Just like TsPageControl.CloseClick. it More convenient.
sorry my bad english.
thanks
pholon
ParticipantJust like tms.advPageCoutrol : OnCloseActivePage, CloseActivePage Method and so on.
pholon
ParticipantI want to free some memory when TsPageControl closing one tabsheet.
Can TsPageControl add a method “CloseActivePage”?
-
AuthorPosts