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 and the Breadcrumb component and the PopupMenu component on the form. Several elements are created for 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 was opened in the area of any element of the Breadcrumb component, the development environment console displays name of this element.
See also: