3
Answers

close wpf user control in VB.net

Ask a question
William EKE

William EKE

10y
3.2k
1
Hi Everyone
I'm stuck on this issue, please help.

I created an user control named "CreateNewCase_uc" within which  I created a button Close named "btnClose"

In my MainWindow, I created a Grid named "grid1" and a button Open named "btnCreateNewCase" with this code

Private Sub btnCreateNewCase_Click(sender As Object, e As RoutedEventArgs)
 
        Dim cnc As CreateNewCase_uc = New CreateNewCase_uc
        grid1.Children.Clear()
        grid1.Children.Add(cnc)
    End Sub




My question : which Code I need to Write for my bntClose button which is inside the user control to close or make disappeared the user control in VB.NET

Thanks in advance for your help.

Answers (3)