Skip to main content

DiagramControl.CustomHitTest Event

Occurs each time the cursor moves while hovering over a diagram item.

Namespace: DevExpress.XtraDiagram

Assembly: DevExpress.XtraDiagram.v24.1.dll

NuGet Package: DevExpress.Win.Diagram

Declaration

[DiagramCategory(DiagramCategory.DiagramPaint)]
public event EventHandler<CustomHitTestEventArgs> CustomHitTest

Event Data

The CustomHitTest event's data class is CustomHitTestEventArgs. The following properties provide information specific to this event:

Property Description
Angle Gets the angle by which the diagram item is rotated around its anchor point relative to the diagram canvas.
Bounds Gets the bounds of the item to which the test points belongs.
Item Gets the item to which the test point belongs.
ItemHeight Gets the height of the item to which the test point belongs.
ItemWidth Gets the width of the item to which the test point belongs.
Point Gets the object that represents the position of the test point relative to the item it belongs to.
Result Gets or sets whether the test point belongs to a diagram item.

Remarks

The CustomHitTest event allows you to implement a custom hit testing logic. It is mainly designed to be used with the DiagramControl.CustomDrawItem event.

Setting the event’s CustomHitTestEventArgs.Result property to false prevents the end-user from selecting the diagram item hovered by the pointer.

See Also