Example:
Private Sub btnChild1_Click(sender As Object, e As EventArgs) Handles btnChild1.Click
Dim myForm As New frmChild1
Try
If Application.OpenForms.OfType(Of frmChild1).Any Then
Application.OpenForms.Item("frmChild1").Activate()
Else
myForm.MdiParent = Me
myForm.TopMost = True
'myForm.WindowState = FormWindowState.Maximized
myForm.Show()
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End Try
End Sub
Download source code for free: Children Form Control
Notice: This script is working find with Visual Studio 2012/2015 and later
0 comments :
Post a Comment