MouseEnter, MouseLeave
We've been trying to simulate these two events forever. We're so glad they finally made it into the product in VFP 7. MouseEnter fires when the mouse moves into the space occupied by a control; MouseLeave fires when the mouse moves out of the control's space.
Usage |
PROCEDURE oObject.MouseEnter LPARAMETERS [ nIndex , ] nButtons, nKeys, nXCoord, nYCoord PROCEDURE oObject.MouseLeave LPARAMETERS [ nIndex , ] nButtons, nKeys, nXCoord, nYCoord |
Parameter |
Value |
Meaning |
nIndex |
Numeric |
The member of a control array that fired the event. |
Omitted |
The control is not in a control array. |
|
nButtons |
0 |
No buttons were pressed when entering or leaving the control. |
1 |
Only the left button was pressed. |
|
2 |
Only the right button was pressed. |
|
3 |
Both the left and right buttons were pressed. |
|
4 |
Only the middle button was pressed. |
|
5 |
Both the middle and left buttons were pressed. |
|
6 |
Both the middle and right buttons were pressed. |
|
7 |
All three buttons were pressed. (Not an easy feat, at least not with a wheel mouse.) |
|
nKeys |
0 |
No modifier keys were pressed when entering or leaving the control. |
1 |
Only the Shift key was pressed. |
|
2 |
Only the Ctrl key was pressed. |
|
3 |
Both the Shift and Ctrl keys were pressed. |
|
4 |
Only the Alt key was pressed. |
|
5 |
Both the Shift and Alt keys were pressed. |
|
6 |
Both the Ctrl and Alt keys were pressed. |
|
7 |
All three modified keys were pressed. (Applies only if OUTSHOW is OFF.) |
|
nXCoord, nYCoord |
Numeric |
The coordinates of the mouse location in the form's ScaleMode. |
Example |
PROCEDURE MouseEnter LPARAMETERS nButton, nKeys, nXCoord, nYCoord This.FontBold = .T. RETURN PROCEDURE MouseLeave LPARAMETERS nButton, nKeys, nXCoord, nYCoord This.FontBold = .F. RETURN |
See Also |
BitTest(), Control Arrays, MouseDown, MousePointer, MouseUp, SpecialEffect, VisualEffect |