I learned, that DragDrop-Mode disables the mouse-move event in Winforms, have a look here: DoDragDrop disables MouseMove Events So I'm not sure if I have the same problem:
I have a UserControl with a Static selected Event:
internal delegate void ProgramPartSelectedDelegate(ProgramPartControl sender, Point offset);
My idea is quite simple: After the user clicks on a Control, he can draw a line to the Point, where the Mouse is. Furthermore I tried to implement a half second of delay.
My Mouse-Move looks like this:
void _form_MouseMove(object sender, MouseEventArgs e)
{
//System.Diagnostics.Debug.WriteLine("{0} {1} 1", this.GetType().Name, MethodBase.GetCurrentMethod().Name);
Point p = new Point(e.X, e.Y);
System.Diagnostics.Debug.WriteLine("p: {0} {1}, _point: {2} {3}", p.X, p.Y, _point.X, _point.Y);
if (p != _point && _selectedPart != null)
{
System.Diagnostics.Debug.WriteLine("Start Timer");
_point = p;
_timerHelper.Start();
}
}
But as soon as the Control in _selectedPart gets set here:
void ProgramPartControl_ControlSelected(ProgramPartControl sender, Point offset)
{
System.Diagnostics.Debug.WriteLine("Contol selected");
_selectedPart = sender;
_partOffset = offset;
}
The mouse-move does not shoot again. Is this a problem of my tinkering or is this the same issue as with DragDrop? If this is a known problem, is there another solution than DragDrop? Basically I dont want to use this since I just want to check the Mouse-Pointer.
Thanks in advance