Try this...
Code:Public Class Form1 Private allowTLPmove As Boolean = False Private newTLPpoint As New Point Private Sub TableLayoutPanel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TableLayoutPanel1.MouseDown, TableLayoutPanel2.MouseDown, TableLayoutPanel3.MouseDown allowTLPmove = True newTLPpoint = New Point(e.X, e.Y) Me.Cursor = Cursors.SizeAll End Sub Private Sub TableLayoutPanel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TableLayoutPanel1.MouseMove, TableLayoutPanel2.MouseMove, TableLayoutPanel3.MouseMove If allowTLPmove = True Then Dim tlp As TableLayoutPanel = DirectCast(sender, TableLayoutPanel) tlp.Location = New Point(tlp.Location.X + e.X - newTLPpoint.X, tlp.Location.Y + e.Y - newTLPpoint.Y) End If End Sub Private Sub TableLayoutPanel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TableLayoutPanel1.MouseUp, TableLayoutPanel2.MouseUp, TableLayoutPanel3.MouseUp If allowTLPmove Then allowTLPmove = False Me.Cursor = Cursors.Default My.Settings.TblPanel1 = TableLayoutPanel1.Location My.Settings.TblPanel2 = TableLayoutPanel2.Location My.Settings.TblPanel3 = TableLayoutPanel3.Location My.Settings.Save() End If End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load TableLayoutPanel1.Location = My.Settings.TblPanel1 TableLayoutPanel2.Location = My.Settings.TblPanel2 TableLayoutPanel3.Location = My.Settings.TblPanel3 End Sub End Class




Reply With Quote
