'宣言 Public ReadOnly Property OwningMenu As PopupMenuTool
public PopupMenuTool OwningMenu {get;}
Imports System.Diagnostics Imports Infragistics.Win Imports Infragistics.Win.UltraWinToolbars Private Sub UltraToolbarsManager1_ToolClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) Handles UltraToolbarsManager1.ToolClick Debug.WriteLine("The Tool with key '" + e.Tool.Key + "' has been clicked. It is of type: '" + e.Tool.GetType().ToString() + "'") ' クリックされたツールのプロパティ情報を表示します Debug.IndentLevel += 1 ' ツール オーナーのプロパティ If Not e.Tool.Owner Is Nothing Then If e.Tool.OwnerIsMenu = True Then Debug.WriteLine("The tool's owner is a menu and the menu's key is: '" + e.Tool.OwningMenu.Key + "'") ElseIf e.Tool.OwnerIsToolbar = True Then Debug.WriteLine("The tool's owner is a toolbar and the toolbar's key is: '" + e.Tool.OwningToolbar.Key + "'") ElseIf e.Tool.OwnerIsToolbarsManager = True Then Debug.WriteLine("The tool is owned by the toolbars manager and is therefore a root tool.") End If End If ' ToolBase.ParentCollection If Not e.Tool.ParentCollection Is Nothing Then Debug.WriteLine("The tool is in a collection that contains a total of " + e.Tool.ParentCollection.Count.ToString() + " entries") End If ' ToolBase.UIElement If Not e.Tool.UIElement Is Nothing Then Debug.WriteLine("The tool's associated UIElement is of type: '" + e.Tool.UIElement.GetType().ToString() + "'") Else Debug.WriteLine("The tool does NOT have an associated UIElement") End If ' ToolBase.UnderlyingTool If TypeOf e.Tool Is MdiMergePlaceholderTool Then Debug.WriteLine("The underlying tool type associated with this MDIMergePlaceholderTool is: '" + e.Tool.UnderlyingTool.GetType().ToString()) End If Debug.IndentLevel -= 1 End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinToolbars; private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { Debug.WriteLine("The Tool with key '" + e.Tool.Key + "' has been clicked. It is of type: '" + e.Tool.GetType().ToString() + "'"); // クリックされたツールのプロパティ情報を表示します Debug.IndentLevel++; // ツール オーナーのプロパティ if (e.Tool.Owner != null) { if (e.Tool.OwnerIsMenu == true) Debug.WriteLine("The tool's owner is a menu and the menu's key is: '" + e.Tool.OwningMenu.Key + "'"); else if (e.Tool.OwnerIsToolbar == true) Debug.WriteLine("The tool's owner is a toolbar and the toolbar's key is: '" + e.Tool.OwningToolbar.Key + "'"); else if (e.Tool.OwnerIsToolbarsManager == true) Debug.WriteLine("The tool is owned by the toolbars manager and is therefore a root tool."); } // ToolBase.ParentCollection if (e.Tool.ParentCollection != null) Debug.WriteLine("The tool is in a collection that contains a total of " + e.Tool.ParentCollection.Count.ToString() + " entries"); // ToolBase.UIElement if (e.Tool.UIElement != null) { Debug.WriteLine("The tool's associated UIElement is of type: '" + e.Tool.UIElement.GetType().ToString() + "'"); } else Debug.WriteLine("The tool does NOT have an associated UIElement"); // ToolBase.UnderlyingTool if (e.Tool is MdiMergePlaceholderTool) Debug.WriteLine("The underlying tool type associated with this MDIMergePlaceholderTool is: '" + e.Tool.UnderlyingTool.GetType().ToString()); Debug.IndentLevel--; }