Maybe this code can help you:
Private dragging As Boolean
Private beginX, beginY As Integer
Private Sub Button2_MouseDown(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles Button2.MouseDown
dragging = True
beginX = e.X
beginY = e.Y
End Sub
Private Sub Button2_MouseMove(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles Button2.MouseMove
If dragging = True Then
Button2.Location = New Point(Button2.Location.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.MouseEventArgs) Handles Button2.MouseUp
dragging = False
End Sub
Greetz Peter
"Ken Tucker [MVP]" <vb***@bellsouth.net> schreef in bericht
news:Oe*************@TK2MSFTNGP15.phx.gbl...
Hi,
http://www.onteorasoftware.com/downl...ovecontrol.zip
Ken
-----------------
"Mark Gaeth" <mg****@mchsi.com> wrote in message
news:uNkQd.440$zH6.51@attbi_s53...
Greetings,
I was lucky one time to have someone provide me a little code that would
allow the user to move a control at runtime. However, I lost that code
snippet when my hard drive failed and now after rebuilding most of the
program from scratch I am in need of that code again. I think it had to do
with getting the x,y of the screen location but I am dazed and confused. I
am a novice programer trying to make a program work for my model railroad
layout and need this to create a dispatcher panel.
Thanks in advance for any assistance.
Mark Gaeth
Decatur, IN