CursorPosition: IGxPoint;
CursorPosition: Prognoz.Platform.Interop.Drawing.GxPoint;
The CursorPosition property returns the point containing current screen coordinates of mouse cursor.
Executing the example requires a form and a button named Button1 on the form.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
CurPosition: IGxPoint;
Begin
CurPosition := WinApplication.CursorPosition;
Self.Text := CurPosition.X.ToString + " | " + CurPosition.Y.ToString;
End Sub Button1OnClick;
On clicking the button the console window displays current screen coordinates of the mouse cursor.
Executing the example requires a .NET form with a button.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Ui;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
WinAppCls: WinApplicationClass = New WinApplicationClassClass();
CurPosition: GxPoint;
Begin
CurPosition := WinAppCls.CursorPosition;
Self.Text := CurPosition.X.ToString() + " | " + CurPosition.Y.ToString();
End Sub;
On clicking the button the form title displays current screen coordinates of the mouse cursor.
See also: