I have Form1 and SplitContainer1 with two panel inside the form. Splitcontainer1.Panel1 in left side and Splitcontainer1.Panel2 at right side. Then I put Form2 in left panel and Form3 in right panel . I would like both form move vertically when I move Form3 with mouse.
I have tried the code bellow (File attached).
When I run the code , Form3 move correctly as I need but no respond from Form2.
Please advice how to move Form2 with mouse move in Form3.
Thank you very much for any help and suggestions.
Public Class Form3 Dim drag As Boolean Dim mousex As Integer Dim mousey As Integer Dim mousey1 As Integer Private Sub Form3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown drag = True 'mousex = Windows.Forms.Cursor.Position.X - Me.Left mousey = Windows.Forms.Cursor.Position.Y - Me.Top mousey1 = Windows.Forms.Cursor.Position.Y - Form2.Top End Sub Private Sub Form3_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If drag Then Me.Top = Windows.Forms.Cursor.Position.Y - mousey Form2.Top = Windows.Forms.Cursor.Position.Y - mousey1 'Me.Left = Windows.Forms.Cursor.Position.X - mousex End If End Sub Private Sub Form3_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp drag = False End Sub End Class
This post has been edited by andrewsw: 24 August 2013 - 03:24 AM
Reason for edit:: Corrected code tags