In VS.NET 2003 new method EnableVisualStyles() has been introduced. When called it is possible for it to crash the event handling code in DotNetBar while DotNetBar is processing the Click event. This is not an issue with DotNetBar rather with this specific method implementation.

Basically, handling Click event on the form itself without DotNetBar will produce the same exception.

To resolve the issue simply call Application.DoEvents() after the EnableVisualStyles() call.

Related posts:

  1. GDI+ Exceptions
  2. Cannot see Office 2003 style on WinXP
  3. Code generation for property failed
  4. Commands in DotNetBar for Windows Forms
  5. ListViewEx limitations and known issues