Try this:
Delphi-Quellcode:
procedure TWebForm.CloseAllButtonClick(Sender: TObject);
begin
with PageControl do
while PageCount > 0 do
ActivePage.Free;
end;
procedure TWebForm.PageControlContextPopup(Sender: TObject;
MousePos: TPoint; var Handled: Boolean);
var
i: integer;
begin
i := PageControl.IndexOfTabAt(MousePos.X, MousePos.Y);
if i <> -1 then
begin
PageControl.ActivePageIndex := i;
Handled := true;
end;
end;
Notice that you can't have a context menu associated with the tab sheet header anymore.
marabu