JavaScript Editor js editor     Web development 

Main Page

Occurs when the user releases a mouse button.

PROCEDURE Object.MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord


You must include an LPARAMETERS or PARAMETERS statement in the event procedure and specify a name for each parameter. Visual FoxPro passes the MouseUp event parameters in the following order.


In Visual FoxPro for Windows, contains a number that specifies which button was released to trigger the event: 1 (left), 2 (right), or 4 (middle).

Contains a number specifying the state of modifier keys when the mouse is released. In Visual FoxPro for Windows, the valid modifier keys are the SHIFT, CTRL, and ALT keys. The values returned in nShift for individual modifier keys are listed in the following table. Modifier key values for nShift

Windows key Value







If more than one modifier key is held down when the mouse is released, the nShift argument contains the sum of the values for the modifier keys. For example, in Visual FoxPro for Windows, if the user holds CTRL while releasing the mouse button, the nShift argument contains 2. But if the user holds CTRL+ALT while releasing the mouse button, the nShift argument contains 6.
nXCoord, nYCoord

Contains the current horizontal (nXCoord) and vertical (nYCoord) position of the mouse pointer within the form. These coordinates are always expressed in terms of the form's coordinate system in the unit of measurement specified by the ScaleMode property of the form.


Applies To: CheckBox | ComboBox | CommandButton | CommandGroup | Container Object | Control Object | EditBox | Form | Grid | Header | Image | Label | Line | ListBox | OptionButton | OptionGroup | Page | PageFrame | Shape | Spinner | TextBox | ToolBar

Use a MouseUp procedure to specify actions to occur when a given mouse button is released. Unlike the Click and DblClick events, the MouseUp event makes it possible for you to distinguish between the left, right, and middle mouse buttons. You can also write code for mouse-keyboard combinations that use the modifier keys.

You can use a MouseMove procedure to respond to an event caused by moving the mouse.

The nButton argument for MouseDown and MouseUp differs from the nButton argument used for MouseMove. For MouseDown or MouseUp, the nButton argument indicates exactly one button per event; for MouseMove, it indicates the current state of all buttons.

See Also

JavaScript Editor js editor     Web development