I want to open a window inside my MDI and only open one, when I open my child window it opens endlessly
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
It's my first window that I want to open and I don't want it to open once
Private Sub mnuProgramme_Click(sender As Object, e As EventArgs) Handles mnuProgramme.Click
Try
Dim frm As New frmProgramme
frm.MdiParent = Me
frm.Show()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
This is my second window that I want to open and I don't want it to open once and I would like to close frmProgramme if it is already open
Private Sub mnuEtudiants_Click(sender As Object, e As EventArgs) Handles mnuEtudiants.Click
Try
For Each f As frmProgramme In Me.MdiChildren
f.Close()
Next
Dim frm1 As New frmEtudiants
frm1.MdiParent = Me
frm1.Show()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
