William EKE

William EKE

  • NA
  • 3
  • 4.2k

close wpf user control in VB.net

Dec 14 2013 3:05 PM
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)