title: C#: Handling Events inside a Class
body: <p>So I'm making a game (specifically Hearthstone) for my Programming II class because I have no better ideas. During my attempt, I realize that creating the Card interface would be much harder than I thought. The Card interface extends the PictureBox class like this:</p>
  
  <pre><code>Card : System.Windows.Form.PictureBox
  </code></pre>
  
  <p>Now, what I want to do is create an event for when the mouse clicks and releases the PictureBox. I know that the way to create the event requires the object sender and EventArgs e, but I'm not sure how to make it handle the actual event. For example, when I write the code</p>
  
  <pre><code>static void Play(object sender, EventArgs e){}
  </code></pre>
  
  <p>I wish to have it handle the PictureBox's OnMouseUp event, but I have no idea what object to say it handles. I searched it up, but either I was using the wrong keywords and not finding the right thing or it hasn't been a post yet. Here's what I have now, and I'm not sure if it works; I haven't really gone around to testing it because I'm not in a computerized area this winter break:</p>
  
  <pre><code>static void Play(object sender, EventArgs e) handles Card.OnMouseUp {}
  </code></pre>
  
  <p>Where Card extends PictureBox. I wanted to use</p>
  
  <pre><code>handles sender.OnMouseUp
  </code></pre>
  
  <p>But I realized that it would not work as sender is a parameter (or would it). Anyways, thanks for your time for looking at this and I hope you guys can solve my problem.</p>