Application.DoEvents() throws null reference exception

  • Thread starter Thread starter Bharathi
  • Start date Start date
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
 
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.
 
Back
Top