
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
536
|
Chapter 9: Delegates, Events, and Anonymous Methods
Discussion
Seven mouse events exist in the System.Windows.Forms.Form class. These are, in the
order in which they occur:
•
MouseEnter
• MouseMove
• MouseHover, MouseDown, or MouseWheel
• MouseUp (if MouseDown was the previously raised event)
•
MouseLeave
Most of these events accept a MouseEventArgs object that contains all the information
about the mouse when the event is raised. The MouseEventArgs class contains the fol-
lowing data:
• Which button the user is acting on
• The number of times the mouse button was clicked
• The direction and speed of the mouse wheel
• The x and y coordinates of the mouse pointer
Your code can make use of any one or more of these events on the
Form class along
with the
MouseEventArgs object.
See Also
See the “Form Class,” “MouseEventArgs Class,” “Control.MouseDown Event,” “Con-
trol.MouseEnter Event,” “Control.MouseHover Event,” “Control.MouseLeave Event,”
“Control.MouseMove Event,” “Control.MouseWheel Event,” “Control.MouseUp
Event,” and “Control.MouseMove Event” topics in the MSDN documentation.
9.12 Using Anonymous Methods
Problem
There is a new feature in C# 2.0 called anonymous methods. While anonymous
methods can be viewed as syntactic sugar for making delegate calls less difficult, you
want to understand ...