Main.Show()参数无效

时间:2018-08-16 20:54:32

标签: bunifu

注意:我正在使用Bunifu,但是每当我将字体更改为Century Gothic或任何非默认字体时,也会发生此错误。

这是我的代码:

Form form = new Main();
form.ShowDialog(new Main());
this.Hide();

问题:

只要在主窗体上进行任何图形更新,都会导致错误“参数无效”。

我尝试过的事情:

this.ShowDialog(new Main());
Application.Run(new Main());
this.Show(new Main());
form.Show();
form.ShowDialog();

完全错误:

System.ArgumentException
  HResult=0x80070057
  Message=Parameter is not valid.
  Source=System.Drawing
  StackTrace:
   at System.Drawing.Drawing2D.GraphicsPath.AddArc(Int32 x, Int32 y, Int32 width, Int32 height, Single startAngle, Single sweepAngle)
   at Bunifu.Framework.UI.BunifuThinButton2.method_0(Graphics graphics_0, Rectangle rectangle_0, Int32 int_4, Pen pen_0, Color color_6)
   at Bunifu.Framework.UI.BunifuThinButton2.Refresh()
   at Bunifu.Framework.UI.BunifuThinButton2.BunifuThinButton2_MouseEnter(Object sender, EventArgs e)
   at Bunifu.Framework.UI.BunifuThinButton2.label1_MouseEnter(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnMouseEnter(EventArgs e)
   at System.Windows.Forms.Label.OnMouseEnter(EventArgs e)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Label.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.RunDialog(Form form)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at Larray_s_Proxy_Tool__v1._0_.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\Jardi\Documents\Visual Studio 2017\Projects\Larray's Proxy Tool (v1.0)\Larray's Proxy Tool (v1.0)\Form1.cs:line 63
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

0 个答案:

没有答案