This is sample code for dragging a button at runtime, should be easy to
modify for other controls
Hope this helps
<<<<<<code>>>>> >
Private dragging As Boolean
Private beginX, beginY As Integer
Private Sub Button2_MouseDo wn(ByVal sender As Object, ByVal e As _
System.Windows. Forms.MouseEven tArgs) Handles Button2.MouseDo wn
dragging = True
beginX = e.X
beginY = e.Y
End Sub
Private Sub Button2_MouseMo ve(ByVal sender As Object, ByVal e As _
System.Windows. Forms.MouseEven tArgs) Handles Button2.MouseMo ve
If dragging = True Then
Button2.Locatio n = New Point(Button2.L ocation.X + e.X -
beginX,Button2. Location.Y + e.Y - beginY)
Me.Refresh()
End If
End Sub
Private Sub Button2_MouseUp (ByVal sender As Object, ByVal e As _
System.Windows. Forms.MouseEven tArgs) Handles Button2.MouseUp
dragging = False
End Sub
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)
"Tull Clancey" <tu**********@b topenworld.com> schreef in bericht
news:KM******** ************@bt .com...
Does anyone have, or can anyone suggest a URL for code to drag a control
around a form at run time? VB.Net 2003.
I have written stuff in VB6 to do this before, but a long time ago and I
don't have the code to refer to anymore.
Cheers,
Tull.