title: WPF loop through textbox controls in grid children
body: <p>I have a big grid that contains many children as buttons, labels and grids. The last grids of the hierarchy contain textboxes.</p>
  
  <p>I want to loop through those textboxes but this isn't working:</p>
  
  <pre><code>For Each g1 As Grid In LayoutRoot.Children
        If (Row.Children.GetType Is GetType(Grid)) Then
          For Each g2 As Grid In g1.Children
              For Each g3 As Grid In g2.Children
                  For Each txtbox As TextBox In g3.Children
                       'Some Code
                  Next
              Next
          Next
      End If
  Next
  </code></pre>