GetMouseXY Method

[Top]  [Chapter]  [Previous]  [Next]

Get mouse page and x,y in twips.


int GetMouseXY(out int PageNr, out int PageX, out int PageY);


This function can be used to calculate the page under the mouse cursor and the X and Y position on the page.


The result value is 0 if there is no page under the mouse cursor, otherwise it can have the following values:









X and Y are measured in twips (inch/1440)


Also see GetXY which retrieves various properties.


Example C#:

  private void wpdllInt1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)


   int x,y,p;

   if (wpdllInt1.Memo.GetMouseXY(out p,out x,out y)>0)


    stHint.Text =

       "P" + p.ToString() +

       "X" + x.ToString() +

       "Y" + y.ToString();



Example VB6:

    Dim x As Long

    Dim y As Long

    Dim page As Long

    Memo.GetMouseXY page, x, y


Coordinate Conversion


RTF2PDF Note: This method is not included IWPEditor

[idh_iwpmemo_getmousexy.htm]    Copyright © 2007 by WPCubed GmbH