Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving a picture 1

Status
Not open for further replies.

aviles22

Programmer
Jun 27, 2000
25
US
i simply need to move a picture where the user drags and drops it to. when i move a picture and drop it, it goes back to where it was. what kind of code do i need to place it where it was dropped.
 
Place a picture box on a form.
Put a picture in the picture box.
Set the OLEDragMode of the Picture box to Automatic.
Set the OLEDropMode of the Form to Manual.
Paste this code in the form

Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Left = X
Picture1.Top = Y
End Sub

Run the application. The picure will drop where ever you drag it.
Snaggs
tribesaddict@swbell.net
To define recursion, we must first define recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top