goodyu372 发表于 2019-2-21 16:11:34

DocumentManager关闭浮动窗体时抛异常

本帖最后由 goodyu372 于 2019-2-21 16:15 编辑


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




代码如下:


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);
      }


{:3_50:} 122628574

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

感激不尽!!!!!2019好人一生平安!

goodyu372 发表于 2019-2-21 16:17:59

devexpress的documentmanager如何关闭浮动窗体

goodyu372 发表于 2019-2-21 16:22:31

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紧接着就抛异常了{:3_42:}

goodyu372 发表于 2019-2-21 16:29:23

{:3_49:}

求大侠赐教
页: [1]
查看完整版本: DocumentManager关闭浮动窗体时抛异常