Dim cordinates As Point Dim i As Integer Dim cbCount As Integer Private Sub Control_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) 'Handles Button1.MouseDown cordinates = New Point(-e.X, -e.Y) 'Holds controls X Y Coordinates while mouse is down End Sub Private Sub Control_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) ' Handles Button1.MouseMove If e.Button = Windows.Forms.MouseButtons.Left Then Dim ControlPosition As Point = Me.PointToClient(MousePosition) ControlPosition.Offset(cordinates.X, cordinates.Y) sender.Location = ControlPosition End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)