The names say it all. I have a panel that acts like a white board. When moving the mouse, move the mouse over the track .. works fine, but if the mouse leaves the edges of the panel, I want to trigger a mouse event and a mouse event if the mouse leaves or enters the panel, and the button on the left is pressed
private void panel2_MouseLeave(object sender, EventArgs e) { if (mousedraw == true) { panel2_MouseUp(sender, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 0, MousePosition.X, MousePosition.Y, 0)); } } private void panel2_MouseEnter(object sender, EventArgs e) { if (mousedraw == true) { panel2_MouseDown(sender, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 0, MousePosition.X, MousePosition.Y, 0)); } }
mousedraw is a bool to find out if the left button is pressed.
Problem :
When you click the mouse, vacation and input events will not fire.
Osama source share