Hello Everyone,
I have this error that accurs in my vb.net forms, when I press the button once it shows me the panel and if I pres the button twice at the same time I get this error : Cannot access a disposed object.
This is the code :
Private Sub OpenChildForm(childForm As Form)
'Open only Form
If currentChildForm IsNot Nothing Then
currentChildForm.Close()
End If
currentChildForm = childForm
'end
childForm.TopLevel = False
childForm.FormBorderStyle = FormBorderStyle.None
childForm.Dock = DockStyle.Fill
PanelDesktop.Controls.Add(childForm)
PanelDesktop.Tag = childForm
childForm.BringToFront()
childForm.Show()
lblFormTitle.Text = childForm.Text
End Sub
and I get the error in this line :
childForm.Show()
Thank you, Best Regards