Showing posts with label 【VISUAL VB NET】Mouse Position. Show all posts
Showing posts with label 【VISUAL VB NET】Mouse Position. Show all posts

Friday, 23 April 2021

【VISUAL VB NET】Mouse Position

 Imports System

Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Linq Imports System.Text Imports System.Threading.Tasks Imports System.Windows.Forms ' make sure that using System.Diagnostics; is included Imports System.Diagnostics ' make sure that using System.Security.Principal; is included Imports System.Security.Principal ' make sure that using System.Runtime.InteropServices; is included Imports System.Runtime.InteropServices Public Class Form1 <StructLayout(LayoutKind.Sequential)> _ Public Structure PointStruct Public X As Integer Public Y As Integer Public Shared Widening Operator CType(point As Point) As PointStruct Return New Point(point.X, point.Y) End Operator End Structure <DllImport("user32.dll")> _ Public Shared Function GetCursorPos(ByRef lpPoint As Point) As Boolean End Function Public Shared Function GetCursorPosition() As Point Dim lpPoint As Point GetCursorPos(lpPoint) Return lpPoint End Function Public Sub New() MyBase.New() InitializeComponent() End Sub Private Sub Form1_MouseMove_1(sender As Object, e As MouseEventArgs) Handles MyBase.MouseMove label1.Text = GetCursorPosition().ToString() End Sub End Class

BREAKING: North Carolina automotive group acquires 7 Upstate dealerships

Breaking news from GSA Business Report Click here to view this message in a browser window. ...