title: How to find which control raised an event, while in so called event? Visual C#
body: <p>I am writing a C# program that takes in a bunch of parameters and does some transformations of data points and then draws them to screen.</p>
  
  <p>On one of my forms I have a bunch of TextBoxes that I would all like to perform the same KeyPress event. Before I would just do a switch statement that would just take in the sender for the KeyPress event and compare it to all the TextBoxes. That method just doesn't seem very efficient to me as now I have 20+ TextBoxes. </p>
  
  <p>What I would like to do is find which TextBox on the form sent the KeyPress event and get further information from that TextBox (IE its Text value, etc.). This would save me the trouble of having to do a huge switch with sender to see what TextBox it was equal too. But I have just been having the hardest time doing so.</p>
  
  <p>I have looked through the System.Windows.Controls &amp; System.Windows.Forms classes to see if I could find anything that would help me. What I was looking for was something that would let me see which control had focus. Maybe that was what I should have been searching for? I have also looked at what I can do with sender in the KeyPress event to see if I could figure out what TextBox raised the event and still no luck.</p>
  
  <p>At this point I feel like I have confused myself more. Any help would be much appreciated.</p>