1. Develop. NET forms, often using mouse events, such as Mousedown/mouseup/mousemove/mouseclick. But sometimes to add mouse events to the control, is not responding, how to do it!
Answer: 1. Whether the control is visible, that is, it cannot be obscured by the control, and if it has been obscured, you can override mouse events for the parent control by invoking the mouse event in the child control, such as the onmousemove of the parent control
2. Try to set the control to input focus in the MouseEnter event (Focus try)
2.MouseDown, MouseMove, MouseUp three events How is the response?
Answer: Tested found
1. When a control can respond to a mouse event, the first Mousedown/mousemove event must be generated by the mouse acting on the control, and the mouse is in the visible part of the control.
2. Once MouseDown acts on the control, the control always responds to the Mousemove/mouseup event, even if the mouse pointer is not over the control or even leaves the form. With this, you know how to implement a change in the size of a control, a form that changes the size of a similar function.
3. How to achieve single mouse double-click event Coexistence?
Answer:
The mouse double-click event must produce a click event, so it is best not to double-click coexistence. If you have to use it, you can start a timer timer in the Click event to capture whether a double-click event has occurred, and the double-clicking event does not occur after the mouse double-clicks the maximum interval. So, clicking on an event is very slow, and the double-click event is more likely to be judged.
4. What does the X/y in the parameter mouseeventargs of the mouse event mean?
This x/y refers to the location where the mouse event occurs, relative to the location of the event source (control), the horizontal coordinate of the top left vertex of the control, and y represents the vertical coordinate of the top left vertex of the distance control.
5. How do I use code to trigger mouse events?
Use Windows function mouse_event, how to use, see my blog post.
winform/some problems in the programming of mouse events in form