开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 2009|回复: 3

DocumentManager关闭浮动窗体时抛异常

[复制链接]

0

精华

8

贡献

466

赞扬

帖子
63
软币
1339
在线时间
97 小时
注册时间
2018-3-21
发表于 2019-2-21 16:11:34 | 显示全部楼层 |阅读模式
本帖最后由 goodyu372 于 2019-2-21 16:15 编辑

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



代码如下:
3.PNG

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下一步就抛异常了。
另外,求教如何关闭浮动窗体?(我关闭非浮动窗体都正常)

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

使用道具 举报

0

精华

8

贡献

466

赞扬

帖子
63
软币
1339
在线时间
97 小时
注册时间
2018-3-21
 楼主| 发表于 2019-2-21 16:17:59 | 显示全部楼层
devexpress的documentmanager如何关闭浮动窗体
回复

使用道具 举报

0

精华

8

贡献

466

赞扬

帖子
63
软币
1339
在线时间
97 小时
注册时间
2018-3-21
 楼主| 发表于 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紧接着就抛异常了

回复

使用道具 举报

0

精华

8

贡献

466

赞扬

帖子
63
软币
1339
在线时间
97 小时
注册时间
2018-3-21
 楼主| 发表于 2019-2-21 16:29:23 | 显示全部楼层


求大侠赐教
回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-4-19 18:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表