Hi,
Das dürfte wie folgt gehen:
Delphi-Quellcode:
procedure TForm1.PageControl1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
TCM_GETITEMRECT = $130A;
var
i: Integer;
r: TRect;
p: TPoint;
begin
with (Sender as TPageControl) do
begin
for i := 0 to PageCount - 1 do
begin
Perform(TCM_GETITEMRECT, i, LPARAM(@r));
if PtInRect(r, Point(X, Y)) then
begin
if i = ActivePage.PageIndex then
begin
p := ClientToScreen(Point(X, Y));
PopupMenu1.Popup(p.X, p.Y);
Exit;
end;
end;
end;
end;
end;
(PS : Vielleicht geht's auch einfacher??)