wiledog 2019-05-08 00:02 采纳率: 100%
浏览 918
已采纳

winform程序,Program中的main方法出现错误

C#写的winform程序,使用了第三方控件DevExpress,页面每隔2秒有数据刷新。
程序多数时间运行正常,但有时运行一段后出现如下错误:
图片说明
请技术大牛帮忙看看

    stackTrace中信息

在 DevExpress.Utils.AppearanceObject.CalcDefaultTextSize(Graphics g)
在 DevExpress.XtraEditors.ViewInfo.BaseControlViewInfo.CalcTextSizeCore(GraphicsCache cache, String text, Int32 maxWidth)
在 DevExpress.XtraEditors.ViewInfo.BaseControlViewInfo.CalcTextSizeCore(Graphics g, String text, Int32 maxWidth)
在 DevExpress.XtraEditors.ViewInfo.BaseControlViewInfo.CalcTextSize(Graphics g, Boolean useDisplayText)
在 DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo.CalcBestFit(Graphics g)
在 DevExpress.XtraEditors.ViewInfo.TextEditViewInfo.CalcMinHeightCore(Graphics g)
在 DevExpress.XtraGrid.Views.Base.ViewInfo.BaseViewInfo.CalcMinEditorHeight(AppearanceObject[] styles)
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcMinRowHeight()
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRectsConstants()
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRects(Rectangle bounds, Boolean partital)
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcCore(Graphics g, Rectangle bounds)
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.Calc(Graphics g, Rectangle bounds)
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.FullRecalcScroll(Graphics g, Rectangle bounds)
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcAfterVertScrollCore(Graphics g, Rectangle bounds, Boolean useCache)
在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcAfterVertScroll(Graphics g, Rectangle bounds, Boolean useCache)
在 DevExpress.XtraGrid.Views.Grid.GridView.RefreshRows(Boolean useCache, Boolean afterScroll)
在 DevExpress.XtraGrid.Views.Grid.GridView.CalculateDataCore()
在 DevExpress.XtraGrid.Views.Grid.GridView.CalculateData()
在 DevExpress.XtraGrid.Views.Base.BaseView.Draw(GraphicsCache e)
在 DevExpress.XtraGrid.Views.Grid.GridView.Draw(GraphicsCache e)
在 DevExpress.XtraGrid.GridControl.OnPaint(PaintEventArgs e)
在 DevExpress.Utils.Drawing.ControlPaintHelper.PaintWithErrorHandling(PaintEventArgs paintEventArgs, Int32 layer)
在 DevExpress.Utils.Drawing.ControlPaintHelper.ProcessWMPaint(Message& m)
在 DevExpress.XtraGrid.GridControl.CheckProcessMsg(Message& m)
在 DevExpress.XtraGrid.GridControl.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • 写回答

3条回答 默认 最新

  • threenewbee 2019-05-08 11:09
    关注

    异常从 frmMain 的构造函数里面丢出,而原因是 XtraGrid 的初始化的异常,你可以先把 XtraGrid 从界面上删除掉,再重新添加,看运行结果,然后逐步添加功能,直到出现错误,以找到错误的原因。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料