Forum Replies Created
-
AuthorPosts
-
pholonParticipant
this is the unite
pholonParticipantyes, I want to have a procedure for a pages closing. and when closing, calling OnCloseBtnClose
pholonParticipantthere 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!
pholonParticipantsPageControl.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
pholonParticipantJust like tms.advPageCoutrol : OnCloseActivePage, CloseActivePage Method and so on.
pholonParticipantI want to free some memory when TsPageControl closing one tabsheet.
Can TsPageControl add a method “CloseActivePage”?
-
AuthorPosts