# MouseEventArgs

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Provides data for the [MouseUp](https://docs.wisej.com/api/wisej.web/general/control/..#mouseup), [MouseDown](https://docs.wisej.com/api/wisej.web/general/control/..#mousedown), and [MouseMove](https://docs.wisej.com/api/wisej.web/general/control/..#mousemove) events.

{% tabs %}
{% tab title="C#" %}

```csharp
public class MouseEventArgs : EventArgs
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class MouseEventArgs
    Inherits EventArgs
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MouseEventArgs(button, clicks, x, y, delta)

Initializes a new instance of the [MouseEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.mouseeventargs) class.

| Name       | Type                                                                                     | Description                                                                                                                                              |
| ---------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **button** | [MouseButtons](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.mousebuttons) | One of the [MouseButtons](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.mousebuttons) values that indicate which mouse button was pressed. |
| **clicks** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | The number of times a mouse button was pressed.                                                                                                          |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | The x-coordinate of a pointer click, in pixels.                                                                                                          |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | The y-coordinate of a pointer click, in pixels.                                                                                                          |
| **delta**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | A signed count of the number of dents the wheel has rotated.                                                                                             |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MouseEventArgs(button, clicks, x, y, delta, role)

Initializes a new instance of the [MouseEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.mouseeventargs) class.

| Name       | Type                                                                                     | Description                                                                                                                                              |
| ---------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **button** | [MouseButtons](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.mousebuttons) | One of the [MouseButtons](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.mousebuttons) values that indicate which mouse button was pressed. |
| **clicks** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | The number of times a mouse button was pressed.                                                                                                          |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | The x-coordinate of a pointer click, in pixels.                                                                                                          |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | The y-coordinate of a pointer click, in pixels.                                                                                                          |
| **delta**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                              | A signed count of the number of dents the wheel has rotated.                                                                                             |
| **role**   | [String](https://docs.microsoft.com/dotnet/api/system.string)                            | The internal role assigned to the element that generated the pointer event.                                                                              |

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Button

[MouseButtons](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.mousebuttons): Returns which mouse button was pressed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Clicks

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the number of clicks or taps.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Delta

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the number of times the mouse wheel has rotated.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Location

[Point](https://docs.microsoft.com/dotnet/api/system.drawing.point): Returns the location of the mouse or pointer event.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) OriginalTarget

[Control](https://docs.wisej.com/api/wisej.web/general/control): Returns the original target [Control](https://docs.wisej.com/api/wisej.web/general/control) when the pointer event has bubbled up because the original target was either not [Enabled](https://docs.wisej.com/api/wisej.web/general/control/..#enabled) or [Anonymous](https://docs.wisej.com/api/wisej.web/general/control/..#anonymous).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Role

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the internal role assigned to the element that generated the pointer event: checkbox, button, ...

The value in the Role property is taken from the "role" attribute of the clicked element inside the widget. You can detect clicks on custom HTML content by adding the role attribute to the custom element.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) X

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the x-coordinate of the mouse or touch event.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Y

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the y-coordinate of the mouse or touch event.

## Used By

| Name                                                                                                  | Description                                                                                                               |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [MouseEventHandler](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.mouseeventhandler) | Represents the method that will handle the MouseDown, MouseUp, or MouseMove event of a form, control, or other component. |
