When I try this code:
foreach (Control ctrl in Grid1.Children)
            {
                    ctrl.Visibility = System.Windows.Visibility.Hidden;
             }
Or even this, which is what i'm really trying to do:
foreach (WebBrowser wb in Grid1.Children)
            {
                    wb.Visibility = System.Windows.Visibility.Hidden;
             }
and it gives me an exception : Unable to cast object of type 'System.Windows.Controls.WebBrowser' to type 'System.Windows.Controls.Control'. Any ideas?
 
     
    