Thursday, September 12, 2013

How is an event parameter passed?

How is an event parameter passed?

I've noticed in C# I can override methods in the Form() parent class, like
so:
protected override void OnPaint(PaintEventArgs e)
{
}
I don't understand how PaintEventArgs is generated and how/when it is
passed to this function. I've got to assume OnPaint() is called every time
the form needs repainting.
Furthermore, when I create button press events they look like this:
private void button1_Click(object sender, EventArgs e)
{
}
Once again, I don't understand how/why these parameters are passed when a
button click is activated.

No comments:

Post a Comment