|
-
Jan 7th, 2002, 10:10 AM
#1
Thread Starter
Hyperactive Member
Load From at Cursor Position?
Is there a way to have my secondary form, Form2, load at the current cursor position?
(Left and Top)
-
Jan 7th, 2002, 10:13 AM
#2
Frenzied Member
Can't you set form2,s left and right positions to be that of the X and Y values. Do it in the Mouse Down event.
-
Jan 7th, 2002, 10:18 AM
#3
Use the following in a module
VB Code:
Private Declare Function GetCursorPos _
Lib "user32" ( _
lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Public Sub ShowForm(frm As Form)
Dim p As POINTAPI
GetCursorPos p
frm.Move p.x * Screen.TwipsPerPixelX, p.y * Screen.TwipsPerPixelY
frm.Show
End Sub
Now instead of calling Form2.Show call ShowForm Form2
Best regards
-
Jan 7th, 2002, 11:10 AM
#4
Thread Starter
Hyperactive Member
Thanks
Thank you Joacim. This works really great.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|