Mouse Coordinates using GiveFeedbackHandler in WPF with DragDropManager

1 Answer 57 Views
DragAndDrop
Zack
Top achievements
Rank 1
Zack asked on 27 Nov 2024, 03:14 PM
Is it possible to get the mouse coordinates while in a handler for this event? It seems like Mouse.GetPosition isn't returning valid information.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 02 Dec 2024, 09:32 AM

Hello Zack,

The mouse position cannot be properly accessed in the DragDropManager.GiveFeedback event. Instead, you can use the DragDropManager.DragOver event and the e.GetPosition() method of the event arguments. If you insist on using the mouse position in the GiveFeedback handler, you can cache it in a field when DragOver is raised and then access the field in the GiveFeedback handler. Or alternatively, you can try the GetCursorPos win32 method.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DragAndDrop
Asked by
Zack
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or