Catching exceptions in an OnPaint PictureBox event

N

Nuno Magalhaes

How can I catch an exception inside an event? I want to capture the
exception of an OnPaint event in a picturebox because sometimes it's
not displayed and gives me an error.

Another question BTW, how can I kill all threads of my application in a
simple and effective way?

Thank you,
Nuno Magalhaes.
 
N

Nuno Magalhaes

I already know it's like this:

protected override void OnPaint(PaintEventArgs pe)
{
try
{
base.OnPaint(pe);
}
catch(Exception)
{
}
}

Thanks anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top