Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata