Point: IPoint;
The Point property returns the point in the area of the Control component, where the context menu was called.
Executing the example requires a form, the Breadcrumb component positioned on it and the PopupMenu component. Several elements have been created in the Breadcrumb. The PopupMenu component is set as 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 called in the area of any element of the Breadcrumb component, the name of this element is displayed in the development environment console.
See also: