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:
Card : System.Windows.Form.PictureBox
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
static void Play(object sender, EventArgs e){}
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:
static void Play(object sender, EventArgs e) handles Card.OnMouseUp {}
Where Card extends PictureBox. I wanted to use
handles sender.OnMouseUp
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.