title: Recognizing sender button control in click event
body: <p>I made a custom button that has a field named <code>Data</code>.</p>
  
  <p>I add this button programatically during runtime to my winform and on adding I also define a click event for them. Well, Actually I only have one method and I subscribe the newly added buttons to this method.</p>
  
  <p>But in the click event I want to access this <code>Data</code> field and show it as a message box, but it seems that my casting is not right:</p>
  
  <pre><code>    CustomButton_Click(object sender, EventArgs e)
      {
          Button button;
          if (sender is Button)
          {
              button = sender as Button;
          } 
  
          //How to access "Data" field in the sender button? 
          //button.Data  is not compiling!
      }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I am sorry, I ment with "is not compiling" that <code>.Data</code> does not show up in intelisense...</p>