
#USE PMOUSE PROCESSING WINDOWS#
These methods all have a Message parameter, which encapsulates the low-level details of Windows messages. Gets the number of lines to scroll when the mouse wheel is rotated.įorms and controls have access to the IMessageFilter interface and a set of overridable methods that process Windows messages at different points in the message queue. Gets the amount of the delta value of the increment of a single mouse wheel rotation. Gets a value indicating whether a mouse with a mouse wheel is installed. Gets a value indicating the current mouse speed, from 1 to 20. Gets a value indicating whether a mouse is installed. Gets the time, in milliseconds, that the mouse pointer has to stay in the hover rectangle before a mouse hover message is generated. Gets the dimensions, in pixels, of the rectangle within which the mouse pointer has to stay for the mouse hover time before a mouse hover message is generated. Gets a value indicating whether the functions of the left and right mouse buttons have been swapped. Gets the maximum number of milliseconds that can elapse between a first click and a second click for the mouse action to be considered a double-click. Gets the dimensions, in pixels, of the area in which the user must click twice for the operating system to consider the two clicks a double-click. The following table summarizes these properties. Also, the SystemInformation class includes properties that describe the capabilities of the mouse and specify how the mouse interacts with the operating system. The SetStyle method takes a bitwise combination of ControlStyles values to determine whether the control will have standard click, double-click behavior, or if the control will handle its own mouse processing. You can detect and change the way a control handles mouse input by deriving from the control and using the GetStyle and SetStyle methods. Used with the appropriate mouse event, MouseHover for example, hit-testing is very useful for determining when your application should do a specific action. Hit-testing capability is built in to several controls in Windows Forms such as the ListView, TreeView, MonthCalendar and DataGridView controls. You can then use mouse location information to carry out hit-testing, and then perform an action based on the location of the mouse. You can obtain the current mouse position with the Location property of the MouseEventArgs when handling a mouse event or by using the Position property of the Cursor class. When the user moves the mouse or presses a mouse button, the Control that contains the HotSpot raises the appropriate mouse event. The mouse pointer contains a single pixel, called the hot spot, which the operating system tracks and recognizes as the position of the pointer. When the user moves the mouse, the operating system moves the mouse pointer. For more information on the mouse events, see Using mouse events. For example, a control can handle the MouseClick event to determine the location of a mouse click. Mouse EventsĪll Windows Forms controls inherit a set of events related to mouse and keyboard input. In other cases, an application may override one of the methods that process messages to intercept a particular message before it's received by the application, form, or control. In many cases, Windows Forms applications can process all user input simply by handling these events. When these methods receive mouse messages, they raise events that can be handled to get information about the mouse input.
#USE PMOUSE PROCESSING SERIES#
A series of overridable methods process these messages at the application, form, and control level.

In Windows Forms, user input is sent to applications in the form of Windows messages.
