[VB.NET]用过UltraTabbedMdiManager的进!!!

前端之家收集整理的这篇文章主要介绍了[VB.NET]用过UltraTabbedMdiManager的进!!!前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
用过UltraTabbedMdiManager的进!!! 最近使用了中的infragistics的UltraTabbedMdiManager,感觉效果很不错!能够做成类似vs.net样式的编辑界面. 现在有个问题,如何把当右键点击选项时弹出的 close 去掉,或是改成中文关闭. 我在论坛上找过,发现有一篇是关于vc的,也试过用vb改写,但是没有成功! 请高手帮忙解决一下! 附vc版的: 看来Help,是覆写UltraTabbedMdiManager的InitializeContextMenu事件。 内容如: private void ultraTabbedMdiManager1_InitializeContextMenu(object sender,Infragistics.Win.UltraWinTabbedMdi.MdiTabContextMenuEventArgs e) { if(e.ContextMenuType==Infragistics.Win.UltraWinTabbedMdi.MdiTabContextMenu.Default) { e.ContextMenu.MenuItems.Clear(); Infragistics.Win.IGControls.IGMenuItem item1=new Infragistics.Win.IGControls.IGMenuItem( 关闭 ); item1.Tag=e.Tab; item1.Click+=new EventHandler(OnCustomMenuItemClose); e.ContextMenu.MenuItems.Add(item1); } } private void OnCustomMenuItemClose(object sender,EventArgs e) { Infragistics.Win.IGControls.IGMenuItem mi=sender as Infragistics.Win.IGControls.IGMenuItem; Infragistics.Win.UltraWinTabbedMdi.MdiTab tab=mi.Tag as Infragistics.Win.UltraWinTabbedMdi.MdiTab; tab.Close(); } __________________________________________________________________________ 还有原帖地址: http://topic.csdn.net/t/20060207/21/4544190.html __________________________________________________________________________ 自己已经解决了 本着方便后然的原则我把我的解决方法写在后面了 Private Sub UltraTabbedMdiManager_InitializeContextMenu(ByVal sender As System.Object,ByVal e As Infragistics.Win.UltraWinTabbedMdi.MdiTabContextMenuEventArgs) Handles UltraTabbedMdiManager.InitializeContextMenu If e.ContextMenuType = Infragistics.Win.UltraWinTabbedMdi.MdiTabContextMenu.Default Then e.ContextMenu.MenuItems.Clear() Dim customMenuItem As New Infragistics.Win.IGControls.IGMenuItem( 关闭 ) customMenuItem.Tag = e.Tab AddHandler customMenuItem.Click,New EventHandler(AddressOf Me.OnCustomMenuItemClose) e.ContextMenu.MenuItems.Add(customMenuItem) End If End Sub Private Sub OnCustomMenuItemClose(ByVal sender As System.Object,ByVal e As System.EventArgs) Dim mi As Infragistics.Win.IGControls.IGMenuItem = sender Dim tab As Infragistics.Win.UltraWinTabbedMdi.MdiTab = mi.Tag TAB.Close() End Sub __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/263635.html

猜你在找的VB相关文章