Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / MouseEvent.cs / 1305376 / MouseEvent.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System;
using System.Drawing;
using System.ComponentModel;
using Microsoft.Win32;
///
///
///
/// Provides data for the ,
/// , and
/// events.
///
///
[System.Runtime.InteropServices.ComVisible(true)]
public class MouseEventArgs : EventArgs {
///
///
/// Which button generated this event [if applicable]
///
private readonly MouseButtons button;
///
///
/// If the user has clicked the mouse more than once, this contains the
/// count of clicks so far.
///
private readonly int clicks;
///
///
/// The x portion of the coordinate where this event occurred.
///
private readonly int x;
///
///
/// The y portion of the coordinate where this event occurred.
///
private readonly int y;
private readonly int delta;
///
///
///
/// Initializes a new instance of the class.
///
///
public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta) {
Debug.Assert((button & (MouseButtons.Left | MouseButtons.None | MouseButtons.Right | MouseButtons.Middle | MouseButtons.XButton1 | MouseButtons.XButton2)) ==
button, "Invalid information passed into MouseEventArgs constructor!");
this.button = button;
this.clicks = clicks;
this.x = x;
this.y = y;
this.delta = delta;
}
///
///
///
/// Gets which mouse button was pressed.
///
///
public MouseButtons Button {
get {
return button;
}
}
///
///
///
/// Gets the
/// number of times the mouse
/// button was pressed and released.
///
///
public int Clicks {
get {
return clicks;
}
}
///
///
///
/// Gets the x-coordinate
/// of a mouse click.
///
///
public int X {
get {
return x;
}
}
///
///
///
/// Gets the y-coordinate of a mouse click.
///
///
public int Y {
get {
return y;
}
}
///
///
///
/// Gets
/// a signed count of the number of detents the mouse wheel has rotated.
///
///
public int Delta {
get {
return delta;
}
}
///
///
///
/// Gets the location of the mouse during MouseEvent.
///
///
public Point Location {
get {
return new Point(x,y);
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SuppressIldasmAttribute.cs
- FlowLayoutPanel.cs
- XmlSerializerVersionAttribute.cs
- WindowVisualStateTracker.cs
- WebPartEditorCancelVerb.cs
- Point.cs
- SoapInteropTypes.cs
- ComponentEditorPage.cs
- CookieProtection.cs
- ImageBrush.cs
- LongValidator.cs
- TableLayoutPanelCellPosition.cs
- TextRunTypographyProperties.cs
- ChtmlSelectionListAdapter.cs
- IconBitmapDecoder.cs
- BasePattern.cs
- ClientTargetSection.cs
- SpanIndex.cs
- HyperLink.cs
- _emptywebproxy.cs
- StrongNameHelpers.cs
- SiteMapDataSourceView.cs
- ToolStripHighContrastRenderer.cs
- TraceListener.cs
- SafeRegistryHandle.cs
- HeaderLabel.cs
- autovalidator.cs
- RangeBaseAutomationPeer.cs
- ComponentDispatcherThread.cs
- PreloadHost.cs
- WhitespaceRuleReader.cs
- ObjectKeyFrameCollection.cs
- FullTextBreakpoint.cs
- DiffuseMaterial.cs
- RemoteWebConfigurationHostStream.cs
- RuntimeResourceSet.cs
- Preprocessor.cs
- CollectionViewProxy.cs
- BamlLocalizableResourceKey.cs
- PassportAuthenticationEventArgs.cs
- TextProperties.cs
- EmissiveMaterial.cs
- ServerIdentity.cs
- COM2ComponentEditor.cs
- TextTreeInsertUndoUnit.cs
- XsdValidatingReader.cs
- AttributeUsageAttribute.cs
- AffineTransform3D.cs
- ValidatedControlConverter.cs
- ColumnResizeUndoUnit.cs
- ValidationHelper.cs
- SqlFormatter.cs
- ToolStripSystemRenderer.cs
- ContainerParaClient.cs
- RegexGroup.cs
- XmlAutoDetectWriter.cs
- DigitalSignatureProvider.cs
- XamlClipboardData.cs
- EventLogTraceListener.cs
- DataViewManager.cs
- Transform3DCollection.cs
- XmlDictionaryReaderQuotasElement.cs
- ScriptResourceAttribute.cs
- DocumentationServerProtocol.cs
- WorkflowRuntimeServiceElement.cs
- X509Certificate2Collection.cs
- OneOfScalarConst.cs
- SpecularMaterial.cs
- SoapRpcServiceAttribute.cs
- EncodingDataItem.cs
- SqlUtil.cs
- SqlPersonalizationProvider.cs
- ValueUtilsSmi.cs
- CmsInterop.cs
- AlignmentXValidation.cs
- PageBorderless.cs
- Point3DCollectionValueSerializer.cs
- SerializerDescriptor.cs
- ConfigurationLocationCollection.cs
- AutoCompleteStringCollection.cs
- LogSwitch.cs
- SimpleWorkerRequest.cs
- Stackframe.cs
- BinaryParser.cs
- WinFormsComponentEditor.cs
- ResXDataNode.cs
- Interlocked.cs
- TextServicesProperty.cs
- CustomGrammar.cs
- Utility.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ResourceAttributes.cs
- CompilerError.cs
- CalendarTable.cs
- AuthorizationRule.cs
- GridProviderWrapper.cs
- SortDescriptionCollection.cs
- CodeAssignStatement.cs
- XamlVector3DCollectionSerializer.cs
- StrokeNodeOperations2.cs