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
ADAdministrator Syncfusion Team August 12, 2005 08:17 PM
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.
GFGraeme FinnAugust 16, 2005 01:00 AM
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;
Point virtualPoint = ((EditControl)sender).PointToVirtualPosition(this.PointToClient(mousePoint)); ((EditControl)sender).CurrentPosition = virtualPoint;
ADAdministrator Syncfusion Team August 16, 2005 08:48 AM
Thanks for sharing this information with us. We are glad that this issue is resolved. We appreciate your continued interest in Syncfusion products.