程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> 關於C# >> 成功解決Developer Express和Janus WinForms Controls中控件的沖突

成功解決Developer Express和Janus WinForms Controls中控件的沖突

編輯:關於C#

最新在做一套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!

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved