成功解决Developer Express和Janus WinForms Controls中控件的冲突

最新在做一套GIS系统的框架,其中用到了Janus WinForms Controls和Developer Express这两个插件。

我用DE的xtraTabbedMdiManager组件来管理我的子窗体。在父窗体中放置了janus的Ribbon控件做菜单。让我比较郁闷的是,直接放上去会在运行的时候会弹出错误窗口,如下:

System.InvalidOperationException: 窗口句柄已存在。
在 System.Windows.Forms.NativeWindow.CheckReleased()
在 System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
在 System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle)
在 Janus.Windows.Ribbon.JNSI.a(Object A_1, EventArgs A_2)
在 System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
在 System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
在 System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
在 System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
在 System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WmShowWindow(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

在网上查了很久,也没有查到相关的资料。今天晚上想起之前解决arcengine里toc和DE的冲突问题的方法。借鉴这个方法,成功解决了这个问题。具体办法如下:

在设计时把xtraTabbedMdiManager的MDIParent设置为无,在父窗体初始化时,加入: xtraTabbedMdiManager1.MdiParent = this;搞定!

希望遇到类似问题的朋友可以借鉴一下!高兴ing!

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索windows , arcengine , forms , system , arcengine ... , arcengine c# , 关于arcengine , message , control , arcengine数据编辑 , wndproc , 控件冲突 , 界面c#arcengine janus developer express、cefsharp.winforms、winforms、spread for winforms、winforms modernui,以便于您获取更多的相关知识。

https://yq.aliyun.com/wenji/96231

原文地址:https://www.cnblogs.com/tianciliangen/p/7840033.html