在Mono中运行Windows窗体程序的System.ArgumentException

时间:2013-09-05 23:14:59

标签: c# .net winforms mono

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

一个注意事项:此页面上唯一不在其他项目上的项目是FlowLayoutPanelProgressBar。没有其他页面上没有的字体。我在下面看到了ToolStripMenuItem mentioned,但页面上没有ToolStrip

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

System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009b] in /root/mono-3.2.1/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:220 
  at 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 
  at System.Drawing.Graphics.MeasureString (System.String text, System.Drawing.Font font, Int32 width, System.Drawing.StringFormat format) [0x00031] in /root/mono-3.2.1/mcs/class/System.Drawing/System.Drawing/Graphics.cs:1986 
  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:MeasureString (string,System.Drawing.Font,int,System.Drawing.StringFormat)
  at System.Windows.Forms.TextRenderer.MeasureTextInternal (IDeviceContext dc, System.String text, System.Drawing.Font font, Size proposedSize, TextFormatFlags flags, Boolean useMeasureString) [0x000eb] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs:263 
  at System.Windows.Forms.TextRenderer.MeasureText (System.String text, System.Drawing.Font font, Size proposedSize, TextFormatFlags flags) [0x00000] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs:117 
  at System.Windows.Forms.ToolStripItem.OnParentChanged (System.Windows.Forms.ToolStrip oldParent, System.Windows.Forms.ToolStrip newParent) [0x00000] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:1202 
  at System.Windows.Forms.ToolStripItem.set_Parent (System.Windows.Forms.ToolStrip value) [0x0001a] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:853 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:set_Parent (System.Windows.Forms.ToolStrip)
  at System.Windows.Forms.ToolStripItemCollection.Remove (System.Windows.Forms.ToolStripItem value) [0x00035] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemCollection.cs:273 
  at System.Windows.Forms.ToolStripItem.Dispose (Boolean disposing) [0x0003b] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:962 
  at System.Windows.Forms.ToolStripDropDownItem.Dispose (Boolean disposing) [0x00089] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownItem.cs:185 
  at System.Windows.Forms.ToolStripMenuItem.Dispose (Boolean disposing) [0x00000] in /root/mono-3.2.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs:221 
  at System.ComponentModel.Component.Finalize () [0x00000] in /root/mono-3.2.1/mcs/class/System/System.ComponentModel/Component.cs:100 

0 个答案:

没有答案