1

设想:

我有一个 Windows 窗体应用程序,按下按钮时会打开另一个窗体。这个打开的表格包含一个 teechart。我没有对它进行太多编程,因为我注意到当我关闭表单时,使用 teechart,然后重新打开它,上面有一个大的红色“X”。我做了几件事:我取消了关闭事件以防止对象中的任何数据丢失。我也隐藏表格。当我在调试模式下运行时,我没有发生任何异常,因此我很难确定发生了什么。

因此,我在 IDE 之外运行可执行文件,当强制执行该场景时,我会弹出以下错误:

************** Exception Text **************
System.ArgumentException: Parameter is not valid.
   at System.Drawing.Graphics.GetHdc()
   at System.Drawing.BufferedGraphics.Render(Graphics target)
   at System.Drawing.BufferedGraphics.Render()
   at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.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)

谁能告诉我这里发生了什么以及如何更好地可视化它?

4

0 回答 0