Thanks for the info on that. I added the IF and also created a test form, but I am just getting strange results, so I don't know where I am going wrong with 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 If allowTLPmove = True Then TableLayoutPanel1.Location = New Point(TableLayoutPanel1.Location.X + e.X - newTLPpoint.X, TableLayoutPanel1.Location.Y + e.Y - newTLPpoint.Y) End If End Sub Private Sub TableLayoutPanel2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TableLayoutPanel2.MouseMove If allowTLPmove = True Then TableLayoutPanel2.Location = New Point(TableLayoutPanel2.Location.X + e.X - newTLPpoint.X, TableLayoutPanel2.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
