Share via


DragEventArgs.GetPosition(UIElement) Method

Definition

Returns a drop point that is relative to a specified UIElement.

public:
 virtual Point GetPosition(UIElement ^ relativeTo) = GetPosition;
Point GetPosition(UIElement const& relativeTo);
public Point GetPosition(UIElement relativeTo);
function getPosition(relativeTo)
Public Function GetPosition (relativeTo As UIElement) As Point

Parameters

relativeTo
UIElement

The UIElement for which to get a relative drop point.

Returns

A point in the coordinate system that is relative to the element specified in relativeTo.

Remarks

For drag-drop operations involving a UI container, you typically call GetPosition using a relativeTo reference to the object that is the sender of the event. This gives the relative position within the container.

If this DragEventArgs is associated with the UIElement.Drop event, then the return value of GetPosition is the drop point.

Applies to

See also