>Private ChildForm As Form > >Private Sub CandidateToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CandidateToolStripMenuItem1.Click > > ChildForm = New personalInformation() > ChildForm.MdiParent = Me > ChildForm.Show() > Me.SizeChanged += New EventHandler(AddressOf MainForm_SizeChanged) > > End Sub > > Private Sub MainForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs) > Dim f As Form = DirectCast(sender, Form) > ChildForm.Width = f.Width / 2 > ChildForm.Height = f.Height / 2 > 'Or whatever > End Sub > >Sorry, I relied on a C# converter without looking properly at the generated code. Try this:
Private ChildForm As Form Private Sub CandidateToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CandidateToolStripMenuItem1.Click ChildForm = New personalInformation() ChildForm.MdiParent = Me ChildForm.Show() End Sub Private Sub MainForm_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged Dim f As Form = DirectCast(sender, Form) ChildForm.Width = CInt(f.Width / 2) ChildForm.Height = CInt(f.Height / 2) 'Or whatever End SubUPDATE: You will need to check that ChildForm exists in MainForm_SizeChanged()