MROW( ) Function

Returns the row position of the mouse pointer in the main Visual FoxPro window or in a user-defined window or form.

MROW([cWindowName | 0 [, nScaleMode]])

Parameters

  • cWindowName
    Specifies the name of a window whose mouse-pointer row position **MROW( )**returns.
  • 0
    Specifies that the row position of the mouse pointer is returned for the currently active window or form.
  • nScaleMode
    Specifies the unit of measurement for the value MROW( ) returns. The settings for nScaleMode are:

    nScaleMode Description

    0

    Foxels. (Default)

    A foxel is equivalent to the average height and width of a character based on the current font of the form in which an object is contained.

    3

    Pixels.

    A pixel is the smallest element that can be displayed on a screen or printer. Pixels are screen-dependent.

Return Value

Numeric. MROW( ) returns the following under specific conditions:

  • If there is no active user-defined window, and you omit the optional argument, MROW( ) returns the main Visual FoxPro window row position of the mouse pointer.

  • If there is an active user-defined window, and you omit the optional argument, MROW( ) returns the mouse-pointer row coordinate relative to the active user-defined window.

  • If the mouse pointer is positioned outside the user-defined window or if no mouse driver is loaded and there is no output window, MROW( ) returns a value of -1.

Remarks

Using the MROW( ) function without the optional argument 0 may affect the behavior of code on forms when the Form AllowOutput property IS set to false (.F.). For example, the placement of a shortcut menu that is defined in the RightClick event may not display in the proper location if you use the MROW( ) and MCOL( ) functions to determine where the menu is displayed. In this case, be sure to include 0 in the MROW( ) and MCOL( ) functions.

See Also

Reference

AMOUSEOBJ( ) Function
COL( ) Function
GridHitTest Method
ISMOUSE( ) Function
MCOL( ) Function
ROW( ) Function
WCOLS( ) Function
WROWS( ) Function

Other Resources

Functions