# MouseDown Event

> Occurs when the user presses a mouse button over TXTextControl, passing the left, right or middle button, the SHIFT, CTRL and ALT key state and X, Y position.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Event
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > MouseDown Event
- **397 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousedown-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousedown-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousedown-event/llms-full.txt

---

Occurs when the user presses a mouse button.

### Syntax

```vbscript
TXTextControl.MouseDown(Button, Shift, X, Y)
```

### Parameters

| Parameter | Description |
|---|---|
| Button | Informs which button is pressed. Possible values are the following: |
| Shift | Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values: |
| X,Y | Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the Text Control. |

#### Button

| Value | Description |
|---|---|
| 1 | The left button is pressed. |
| 2 | The right button is pressed. |
| 4 | The middle button is pressed. |

#### Shift

| Value | Description |
|---|---|
| 1 | The SHIFT key was pressed at the time of the event. |
| 2 | The CTRL key was pressed at the time of the event. |
| 4 | The ALT key was pressed at the time of the event. |

### Data Types

| Name | Data type |
|---|---|
| Button | Integer |
| Shift | Integer |
| X | Long |
| Y | Long |

### See Also

- [KeyDown Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/keydown-event/llms-full.txt)
- [KeyUp Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/keyup-event/llms-full.txt)
- [MouseMove Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousemove-event/llms-full.txt)
- [MouseUp Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mouseup-event/llms-full.txt)
- [Programming Category: Text Selections and Character Input](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/selections/llms-full.txt)

---

## Nearby

- **Previous:** [MisspelledWordStart Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/misspelledwordstart-property/llms-full.txt)
- **Next:** [MouseMove Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/mousemove-event/llms-full.txt)
