窗体.Show()时显示错误信息
lypvc 2009-03-25 11:22:39 我在mdi窗体里双击列表打开子窗体时出现下列错误信息.
打开代码.
Form1 f1=new Form1()
f1.MdiParent = this;
f1.show()
出现下列错误.偶尔出现下列错误信息.如果我双击列表快的话就不容易出现错误,如果慢的话就会出现.不知道为什么?
System.OutOfMemoryException: 创建窗口句柄时出错。
---> System.NullReferenceException: 未将对象引用设置到对象的实例。
在 System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
--- 内部异常堆栈跟踪的结尾 ---
在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
在 System.Windows.Forms.Control.CreateHandle()
在 System.Windows.Forms.Form.CreateHandle()
在 System.Windows.Forms.Control.get_Handle()
在 System.Windows.Forms.Form.SetVisibleCore(Boolean value)
在 System.Windows.Forms.Control.Show()