Search code examples
c#drag-and-dropnull

C# How to debug Control.DoDragDrop Method


I'm reading a foreign source code and there occurs sometimes a

NullException 

by Drag'n'Drop operation. The problem is, that all parameters are never null, so I'd like to be able to debug this method somehow.

Any ideas ?


Solution

  • Any exception thrown while a drag+drop is in progress is swallowed by a catch all handler in DoDragDrop. You can see the first-chance exception in the Output window but that's all. To get the debugger to stop use Debug + Exceptions, tick the Thrown checkbox on CLR exceptions.