title: C# Array of TextBoxes
body: <p>I am writing in WPF Sudoku and I need an Array of TextBoxes.
  I have 81 textboxes their names is starts with txt11, txt21, txt31, that means that the first txt in line 1 and column 1, second txt in line 1 and column 2 ...etc.</p>
  
  <p>My code is:</p>
  
  <pre><code>private TextBox[,] texts = new TextBox[9, 9];
  
  void Initialization_text()
      {
  
          texts[0, 0] = txt11;
          texts[0, 1] = txt21;
          texts[0, 2] = txt31;
          texts[0, 3] = txt41;
          texts[0, 4] = txt51;
          texts[0, 5] = txt61;
          texts[0, 6] = txt71;
          texts[0, 7] = txt81;
          texts[0, 8] = txt91;
  
  ..................
  }
  </code></pre>
  
  <p>but I want it like this:</p>
  
  <pre><code>void Initialization_text()
     {
  
          for (int i = 0; i &lt; 9; i++)
          {
              for (int j = 0; j &lt; 9; j++)
              {
                  texts[i, j] = (TextBox)Control["txt" + j+i];//j will be the column and i will be the line
              }
          }
  </code></pre>
  
  <p>but it does not work.
  and I dont know how to solve it</p>