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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Image via Click&Drag

Status
Not open for further replies.

victoryhighway2

Programmer
Jul 18, 2005
42
US
Greetings All,
I'm writing a section of a program where I would like to allow a user to click & drag on an image control on a form and move it based on the user's mouse movements. I'm sure that doing so involves the MouseDown, MouseMove and MouseUp events, but does anyone have a code sample that demonstrates this?

Regards,
Geoffrey
 
Something like

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
With Source
.Left = X
.Top = Y
End With
Source.SetFocus
End Sub

Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top