title: how to declare and use the event handler for dynamically created array of textboxes in wp7 using C#?
body: <p>I'm new to windows phone 7. I had created a array of textboxes dynamically. And I don't know where and how to declare and use the event handler for the textboxes. My code is shown below:</p>
  
  <pre><code> public partial class MainPage : PhoneApplicationPage
  {
      public TextBox[] textbox;
      public MainPage()
      {
          InitializeComponent();
          string[] str = new string[2];
          str[0] = "force";
          str[1] = "force components";
           textbox = new TextBox[2];
  
          for (int i = 0; i &lt; 2; i++)
          {
              textbox[i] = new TextBox { Text = str[i] };
      textbox[i].Tap += new System.EventHandler(this.textbox[i]_Tap);
              listBox1.Items.Add (textbox[i]);
          }
      }
  private void textbox[0]_Tap(object sender, RoutedEventArgs e)
       {
  
       }
  private void textbox[1]_Tap(object sender, RoutedEventArgs e)
       {
  
       }
   }
  </code></pre>
  
  <p>The above code shows error, while declaring and using the event handler method. please help me with a understandable piece of code, to clear my errors. Thank You for All.</p>