With the following code i am able to move a panel inside my Windows-Form during run time.
Private position As New Point()
Private Sub Pnl_Osc_Settings_MouseMove(sender As Object, e As MouseEventArgs) Handles Pnl_Osc_Settings.MouseMove
Dim p As Panel = CType(Pnl_Osc_Settings, Panel)
If e.Button = MouseButtons.Left Then
Dim mousePos As Point = Me.PointToClient(Control.MousePosition)
If position.IsEmpty = True Then
position = New Point(mousePos.X - p.Left, mousePos.Y - p.Top)
End If
p.Location = New Point(mousePos.X - position.X, mousePos.Y - position.Y)
ElseIf Not position.IsEmpty = True Then
position = New Point()
End If
End Sub
Is there an option to move this panel outside of my windows form? Many thanks in advance!