Devexpress的DocumentManager关闭浮动窗体时抛异常

Devexpress的DocumentManager关闭浮动窗体时抛异常
如图,这是被我拖拽出的一个浮动窗体,当我点击右上角x关闭按钮时,抛如下异常:
Devexpress的DocumentManager关闭浮动窗体时抛异常
代码如下:
Devexpress的DocumentManager关闭浮动窗体时抛异常

private void tabbedView1_DocumentClosing(object sender, DevExpress.XtraBars.Docking2010.Views.DocumentCancelEventArgs e)
{
//document.Control.Dispose();
e.Document.Form.Close();
this.documentManager1.View.Documents.Remove(e.Document);
}

求助如何解决? 我在这段代码中加try catch不会捕捉到异常,按F10下一步就抛异常了。
另外,求教如何关闭浮动窗体?(我关闭非浮动窗体都正常)

devexpress的documentmanager如何关闭浮动窗体?
SetWindowSubClass Failed 这是异常信息

堆栈如下:
在 DevExpress.Utils.Drawing.Helpers.Win32SubclasserFactory.Win32Subclasser.AssignHandle()
在 DevExpress.Utils.Drawing.Helpers.Win32SubclasserFactory.Create(IntPtr hWnd, WndProc wndProc)
在 DevExpress.XtraBars.Docking2010.Views.BaseDocumentCollection.WM_CLOSE_Interceptor…ctor(IntPtr hWnd)
在 DevExpress.XtraBars.Docking2010.Views.BaseDocumentCollection.OnSCClose(IntPtr hWnd)
在 DevExpress.XtraBars.Docking2010.Views.BaseDocumentCollection.WM_SYSCOMMAND_Interceptor.WndProc(Message& m)
在 DevExpress.Utils.Drawing.Helpers.Win32SubclasserFactory.Win32SubClassProcClosure.SubClassProc(IntPtr hWnd, IntPtr msg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, IntPtr dwRefData)
在 DevExpress.Utils.Drawing.Helpers.Win32SubclasserFactory.Win32Subclasser.SubClassProcInner(IntPtr hWnd, IntPtr Msg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, IntPtr dwRefData)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 WorkDevelop.Program.Main() 位置 D:\Git\WorkDevelop\WorkDevelop\Program.cs:行号 70

我确定不是我的程序代码出了问题,document_closing跟踪完在try catch里都不抛异常,下一步按f11/f10紧接着就抛异常了

相关文章:

  • 2021-12-29
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2021-12-06
  • 2021-07-05
  • 2022-03-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-26
  • 2021-07-30
  • 2022-01-31
  • 2022-12-23
  • 2021-12-02
  • 2021-09-29
相关资源
相似解决方案