שתף באמצעות


Open form at cursor location

Question

Wednesday, February 1, 2006 1:24 PM

All,

An easy question for all you hard coders out there. How do you open a form but  position the form on the screen where the mouse pointer currently is?? I ve tried using

 

form.location=cursor.position

 

but it tells me the syntax is not correct

 

Hope you can help

All replies (2)

Wednesday, February 1, 2006 4:31 PM ✅Answered | 1 vote

try this code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.Location = Windows.Forms.Cursor.Position

End Sub


Thursday, January 12, 2017 1:18 PM

Nice to know :-)