使用DevComponents.DotNetBar导致的异常

在做C# WinForm开发时 一直都觉得.NET自身提供的控件组合到一起的界面太难看 于是在leader的推荐下 使用了DevComponets.DotNetBar 这个库里提供了许多功能类似于.Net控件功能的控件  不过 有一点就是界面做的很好看 仿office的

之前用着一直没有出现什么异常 今天用到其中的ListViewEx 在窗口最小化的时候产生异常 异常如下

 

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.OverflowException: Overflow error.
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect)
   at DevComponents.DotNetBar.Presentation.c00028d.PaintFill(Graphics g, Rectangle r)
   at DevComponents.DotNetBar.Presentation.c00028d.Paint(c000232 p)
   at DevComponents.DotNetBar.Presentation.c00022b.Paint(c000232 p)
   at DevComponents.DotNetBar.Presentation.c00028d.Paint(c000232 p)
   at DevComponents.DotNetBar.ScrollBar.c000287.PaintTrackHorizontal(Graphics g, Rectangle bounds, enum00028a state)
   at DevComponents.DotNetBar.ScrollBar.ScrollBarCore.Paint(ItemPaintArgs p)
   at DevComponents.DotNetBar.Controls.c00027f.PaintNonClientArea(Graphics g)
   at DevComponents.DotNetBar.Controls.c00027f.m0004e4()
   at DevComponents.DotNetBar.Controls.c00027f.m0004dd(Message& p0)
   at DevComponents.DotNetBar.Controls.c00027f.WndProc(Message& m)
   at DevComponents.DotNetBar.Controls.ListViewEx.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
RierLogManagement
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/管理员卡/桌面/平台/RierLogManagement.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
DevComponents.DotNetBar2
    Assembly Version: 7.3.0.6
    Win32 Version: 7.3.0.6
    CodeBase: file:///C:/Documents%20and%20Settings/管理员卡/桌面/平台/DevComponents.DotNetBar2.DLL
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

看了一下 异常信息 发现时在重绘ListViewEx控件时导致错误 于是换用.net本身的ListView异常解决 网上很多这种问题 但是原因貌似没有找到 我推想可能是组件本身存在的bug

原文地址:https://www.cnblogs.com/ATually/p/1909318.html