Point: IPoint;
The Point property returns the point in the area of the Control component where the context menu opened.
Executing the example requires a form, the Breadcrumb component on it, and the PopupMenu component. Several elements are created in the Breadcrumb. The PopupMenu component is set as a context menu for the Breadcrumb component.
Sub PopupMenu1OnPopup(Sender: Object; Args: IPopupMenuEventArgs);
Var
Br: IBreadcrumb;
Elem: Integer;
Begin
If Args.Control Is Breadcrumb Then
Br := Args.Control As IBreadcrumb;
Elem := Br.HitTest(Args.Point);
If Elem <> -1 Then
Debug.WriteLine(Br.Items.Item(Elem).Text);
End If;
End If;
End Sub PopupMenu1OnPopup;
After executing the example, if the context menu opened in the area of any element of the Breadcrumb component, the name of this element is displayed in the development environment console.
See also: