Tuesday, 1 October 2013

Can't call event from button

Can't call event from button

I have three different events:
form_load
button_click
pnlTiles_Paint
My button click event I have:
private void btnUpdate_Click(object sender, EventArgs e)
{
pnlTiles.Paint += pnlTiles_Paint;
}
My form_load event I have:
private void frmMain_Load(object sender, EventArgs e)
{
pnlTiles.Paint += pnlTiles_Paint;
}
Now my problem is that the event gets called when I use it in form_load
but when I use it in the button event; it just skips over the event, I
tried to step into the event when debugging the button click. But I made
no progress on trying to figure out why the event doesn't get called from
the button.

No comments:

Post a Comment