Application.DoEvents() throws null reference exception

B

Bharathi

Hi,

I have an application where I have used Application.DoEvents() method
on the click event of a NumericUpDown. This particular method is
throwing "Object reference not set to an instance of an object"
error.. Does anyone have any idea about it?

Regards,
Bharathi
 
C

Chris Nahr

DoEvents is reentrant and can thus produce any random error you could
ever imagine. You should never use DoEvents at all. Microsoft should
never even have put this method in the BCL. Use background threads if
you need to do work without blocking the GUI.
 

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