mouseControl

returns the number of the control the mouse pointer is over.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

the mouseControl

# Examples

the mouseControl

if the number of the mouseControl is 2 then set the cursor to hand

# Description

Use the mouseControl function to change the stack behavior depending on what control the mouse is over, or to perform some action on the control the mouse is over.

The control number returned in the mouseControl function is the same as the control layer property.

If the mouse is not over a control, the mouseControl function returns empty.

If the mouse button is down, the mouseControl function returns the control that was clicked, even if the mouse has moved to another control.

If the mouse is over a graphic that is not selected, its interior is considered to be within the graphic only if the graphic's filled property is true. If the graphic filled is false and the graphic is not selected, the mouseControl returns the graphic number only if the mouse is over the graphic border.

# Tags

ui,

# See

- **property:** filled, layer - **message:** mouseEnter, mouseLeave - **keyword:** string, control, graphic - **object:** stack, graphic - **function:** within, mouseCharChunk - **glossary:** property, mouse pointer, return - **control structure:** function