1

我使用 Visual Studio 2010 用 C# 编写了一个 Windows 窗体应用程序。它有一个带有多个页面的选项卡控件。所有页面在 Mono 中都能正常工作,除了一个页面,当单击该页面时,会导致应用程序终止并出现下面显示的错误。您可以看到页面开始绘制,然后失败。

请注意:此页面上唯一不在其他页面上的项目是 aFlowLayoutPanel和 a ProgressBar。没有不在其他页面上的字体。我ToolStripMenuItem mentioned在下面看到,但ToolStrip页面上没有。

任何帮助,将不胜感激。谢谢。

System.ArgumentException:找到空引用或无效值 [GDI+ 状态:无效参数]
  在 System.Drawing.GDIPlus.CheckStatus(状态状态)[0x0009b] 在 /root/mono-3.2.1/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:220
  在 System.Drawing.Graphics.GdipMeasureString (IntPtr graphics, System.String text, System.Drawing.Font font, System.Drawing.RectangleF& layoutRect, IntPtr stringFormat) [0x00053] in /root/mono-3.2.1/mcs/class /System.Drawing/System.Drawing/Graphics.cs:1953
  在 System.Drawing.Graphics.MeasureString(System.String 文本,System.Drawing.Font 字体,Int32 宽度,System.Drawing.StringFormat 格式)[0x00031] 在 /root/mono-3.2.1/mcs/class/System。绘图/System.Drawing/Graphics.cs:1986
  在 (wrapper remoting-invoke-with-check) System.Drawing.Graphics:MeasureString (string,System.Drawing.Font,int,System.Drawing.StringFormat)
  在 System.Windows.Forms.TextRenderer.MeasureTextInternal (IDeviceContext dc,System.String 文本,System.Drawing.Font 字体,大小建议大小,TextFormatFlags 标志,布尔 useMeasureString)[0x000eb] 在 /root/mono-3.2.1/mcs/类/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs:263
  在 /root/mono-3.2.1/mcs/class/Managed.Windows 中的 System.Windows.Forms.TextRenderer.MeasureText(System.String 文本,System.Drawing.Font 字体,Size建议大小,TextFormatFlags 标志)[0x00000]。 Forms/System.Windows.Forms/TextRenderer.cs:117
  在 /root/mono-3.2.1/mcs/class/Managed.Windows 中的 System.Windows.Forms.ToolStripItem.OnParentChanged (System.Windows.Forms.ToolStrip oldParent, System.Windows.Forms.ToolStrip newParent) [0x00000]。 Forms/System.Windows.Forms/ToolStripItem.cs:1202
  在 System.Windows.Forms.ToolStripItem.set_Parent (System.Windows.Forms.ToolStrip 值)[0x0001a] 在 /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem .cs:853
  在 (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:set_Parent (System.Windows.Forms.ToolStrip)
  在 System.Windows.Forms.ToolStripItemCollection.Remove(System.Windows.Forms.ToolStripItem 值)[0x00035] 在 /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemCollection .cs:273
  在 System.Windows.Forms.ToolStripItem.Dispose(布尔处理)[0x0003b] 在 /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:962
  在 System.Windows.Forms.ToolStripDropDownItem.Dispose(布尔处理)[0x00089] 在 /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownItem.cs:185
  在 System.Windows.Forms.ToolStripMenuItem.Dispose(布尔处理)[0x00000] 在 /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs:221
  在 /root/mono-3.2.1/mcs/class/System/System.ComponentModel/Component.cs:100 中的 System.ComponentModel.Component.Finalize () [0x00000]
4

0 回答 0