The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I would like the cursor position to follow the mouse pointer position as the user drags an item to drop onto the editor control.
Currently I use:
((EditControl)sender).CurrentPosition = ((EditControl)sender).PointToVirtualPosition(this.PointToClient(new Point(e.X , e.Y)));
In the drag over event, and it works ok but it seems to be offset by an amount as the cursor is always below the mouse pointers position.
I was wanting to know if I need to add an offset in, or am I using the right methods to translate the point to get this to follow the point of the mouse cursor?
Thanks In Advance
Graeme
ADAdministrator Syncfusion Team August 12, 2005 08:17 PM
Hi Graeme,
Try the following code instead and let me know if this workd for you :
Point virtualPoint = this.editControl1.PointToVirtualPosition(Control.MousePosition);
this.editControl1.CurrentPosition = virtualPoint;
this.editControl1.InsertText(this.editControl1.CurrentPosition.X, this.editControl1.CurrentPosition.Y, text);
Let me know if this works for you. We appreciate your interest in Syncfusion products.
Regards,
Guru Patwal
Syncfusion, Inc.
GFGraeme FinnAugust 16, 2005 01:00 AM
Guru,
Thanks but that didn''t fix my problem. However I did find the solution to my problem. So i''m just posting it here for completeness as someone else might need it:
Point mousePoint = Control.MousePosition;
mousePoint.Offset(0, -Cursor.Size.Height);
Point virtualPoint = ((EditControl)sender).PointToVirtualPosition(this.PointToClient(mousePoint)); ((EditControl)sender).CurrentPosition = virtualPoint;
Cheers,
Graeme
ADAdministrator Syncfusion Team August 16, 2005 08:48 AM
Hi Graeme,
Thanks for sharing this information with us. We are glad that this issue is resolved. We appreciate your continued interest in Syncfusion products.
Regards,
Guru Patwal
Syncfusion, Inc.