0

I'm having a problem with user control..
how can i disable from the panel the user control if another user control is selected from menustrip???

here is my code at the moment

Private Sub LabToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LabToolStripMenuItem.Click
        If LabToolStripMenuItem.Enabled = True Then
            Dim fmLabModuleUC As New LabModuleUC()
            fmLabModuleUC.Dock = DockStyle.Fill

            Panel1.Controls.Add(fmLabModuleUC)

            fmLabModuleUC.Show()

        End If
        If LabToolStripMenuItem.Enabled = False Then
            Panel1.Controls.Clear()
        End If
    End Sub

hope you'll help me with this..
God bless!

2
Contributors
3
Replies
7
Views
6 Years
Discussion Span
Last Post by lolafuertes
0

Remove te offending cotrol from the Panel.Controls collection, or fully clear the panel.Controls before adding the new user control.

Hope this helps

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.