|
-
Oct 13th, 2004, 01:08 PM
#1
Thread Starter
Lively Member
Move a picture box into a form
Hi:
I have a problem, how can I move a picture box into a form in run time?, I mean, I want to change the position with the drag drop procedure, Does anybody know how can I do it?
Thanks a lot, and regards.
-
Oct 13th, 2004, 02:17 PM
#2
Here is a quick sample for you:
VB Code:
Option Explicit
Dim intOffsetX As Integer
Dim intOffsetY As Integer
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Drag vbEndDrag
Source.Move X - intOffsetX, Y - intOffsetY
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Picture1.Drag vbBeginDrag
intOffsetX = X
intOffsetY = Y
End If
End Sub
-
Oct 13th, 2004, 04:10 PM
#3
Thread Starter
Lively Member
(RESOLVED)
Thank you very much RB, it work's perfectly.
Regards.
-
Oct 14th, 2004, 12:28 AM
#4
add the checkmark to the first post in the thread to resolve it!
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
|