Hi sb67pro. Use TabRect function like this:
procedure TForm1.PopupMenu1Popup(Sender: TObject);
var
CurPos: TPoint;
R: TRect;
i: Integer;
begin
if GetCursorPos(CurPos) then
begin
CurPos:= PageControl1.ScreenToClient(CurPos);
for i:= 0 to PageControl1.PageCount-1 do
begin
R:= PageControl1.TabRect(i);
if (CurPos.X >= R.Left) and (CurPos.X <= R.Right) and (CurPos.Y >= R.Top) and (CurPos.Y <= R.Bottom) then
Caption:= 'Clicked on tab of page ' + IntToStr(i);
end;
end;
end;