This doesn`t look like a good approach.. find another logic to clear your texts.. but if you just want to know how it would work...
the easiest way:
IEnumerable<myType> collection = control.Children.OfType<myType>();
(control is the root element of the window and myType would be groubBox in your case)
The microsoft way to get through all elements Link:
// Enumerate all the descendants of the visual object.
static public void EnumVisual(Visual myVisual)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(myVisual); i++)
{
// Retrieve child visual at specified index value.
Visual childVisual = (Visual)VisualTreeHelper.GetChild(myVisual, i);
// Do processing of the child visual object.
// Enumerate children of the child visual object.
EnumVisual(childVisual);
}
}