相关疑难解决方法(0)

如何解决winforms错误"GDI +中发生了一般错误."?

我在C#.net win forms应用程序中遇到以下异常.

GDI +中发生了一般错误.
在System.Drawing.Graphics.CheckErrorStatus(Int32 status)
的System.Drawing.Graphics.DrawRectangle(Pen pen,Int32 x,Int32 y,Int32 width,Int32 height)
at WeifenLuo.WinFormsUI.Docking.DockWindow.OnPaint(PaintEventArgs e)
在System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,Int16 layer,Boolean disposeEventArgs)
处于System.Windows.Forms.Control.WmPaint(Message&m)
的System.Windows.Forms.Control.WndProc(Message&m)
at System
System.Windows.Forms上System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)
的System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)
中的.Windows.Forms.ScrollableControl.WndProc(Message&m).NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)

最令人困惑的一点是,当应用程序加载表单(包含一些丰富的图形,WPF工作等)时,很少会出现表单成功加载的大约90%的时间.但很少有时候它会被复制,而且只在某些机器上运行,在某些其他机器上,这种形式在100%的时间内都可以工作,并且永远不会遇到这种情况.

我不知道为什么会发生这种异常,因为它也没有显示导致异常的确切堆栈跟踪.如果有人知道如何处理它,请建议.

forms windows c#-2.0

4
推荐指数
1
解决办法
4547
查看次数

标签 统计

c#-2.0 ×1

forms ×1

windows ×1