This will return null except for tools that contain controls, e.g. ControlContainerTool and PopupControlContainerTool.
Imports System.Diagnostics Imports Infragistics.Win Imports Infragistics.Win.UltraWinToolbars Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click Debug.WriteLine("Tool property values") Debug.IndentLevel += 1 Dim toolbar As UltraToolbar For Each toolbar In Me.UltraToolbarsManager1.Toolbars Debug.WriteLine("Toolbar '" + toolbar.Key + "' tool info -----------------------") Debug.IndentLevel += 1 Me.ProcessToolsCollection(toolbar.Tools) Debug.IndentLevel -= 1 Next Debug.IndentLevel -= 1 End Sub Private Sub ProcessToolsCollection(ByVal tools As ToolsCollection) Dim tool As ToolBase For Each tool In tools Debug.IndentLevel += 1 ' Display properties common to all tools (inherited from ToolBase). Debug.WriteLine("Tool #" + tool.Index.ToString() + " (Key: " + tool.Key + ") is a " + tool.GetType().Name.ToString()) Debug.IndentLevel += 1 Debug.WriteLine("Its default size is: " + tool.DefaultSize.ToString()) Debug.WriteLine("Its minimum size is: " + tool.MinimumSize.ToString()) If tool.IsControlContainer = True Then Debug.WriteLine("It IS a control container") Else Debug.WriteLine("It is NOT a control container") End If If tool.CanActivate = True Then Debug.WriteLine("It CAN be activated") Else Debug.WriteLine("It CANNOT be activated") End If If tool.ShouldDisplayToolTip = True Then Debug.WriteLine("It WILL display a tooltip if available") Else Debug.WriteLine("It will NOT display a tooltip") End If If Not tool.Control Is Nothing Then Debug.WriteLine("Its associated control is of type: " + tool.Control.GetType().Name) End If If Not tool.AttachedParentTool Is Nothing Then Debug.WriteLine("Its AttachedParentTool has a key of: " + tool.AttachedParentTool.Key) End If If tool.InstanceDisplaysImage = True Then Debug.WriteLine("It WILL display an image if one has been assigned") Else Debug.WriteLine("It will NOT display an image") End If If tool.InstanceDisplaysText = True Then Debug.WriteLine("It WILL display text if assigned") Else Debug.WriteLine("It will NOT display text") End If Debug.WriteLine("Its Height is: " + tool.Height.ToString()) Debug.IndentLevel -= 1 Debug.IndentLevel -= 1 Next End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinToolbars; private void button21_Click(object sender, System.EventArgs e) { Debug.WriteLine("Tool property values"); Debug.IndentLevel++; foreach(UltraToolbar toolbar in this.ultraToolbarsManager1.Toolbars) { Debug.WriteLine("Toolbar '" + toolbar.Key + "' tool info -----------------------"); Debug.IndentLevel++; this.ProcessToolsCollection(toolbar.Tools); Debug.IndentLevel--; } Debug.IndentLevel--; } private void ProcessToolsCollection(ToolsCollection tools) { foreach(ToolBase tool in tools) { Debug.IndentLevel++; // Display properties common to all tools (inherited from ToolBase). Debug.WriteLine("Tool #" + tool.Index.ToString() + " (Key: " + tool.Key + ") is a " + tool.GetType().Name.ToString()); Debug.IndentLevel++; Debug.WriteLine("Its default size is: " + tool.DefaultSize.ToString()); Debug.WriteLine("Its minimum size is: " + tool.MinimumSize.ToString()); if (tool.IsControlContainer == true) Debug.WriteLine("It IS a control container"); else Debug.WriteLine("It is NOT a control container"); if (tool.CanActivate == true) Debug.WriteLine("It CAN be activated"); else Debug.WriteLine("It CANNOT be activated"); if (tool.ShouldDisplayToolTip == true) Debug.WriteLine("It WILL display a tooltip if available"); else Debug.WriteLine("It will NOT display a tooltip"); if (tool.Control != null) Debug.WriteLine("Its associated control is of type: " + tool.Control.GetType().Name); if (tool.AttachedParentTool != null) Debug.WriteLine("Its AttachedParentTool has a key of: " + tool.AttachedParentTool.Key); if (tool.InstanceDisplaysImage == true) Debug.WriteLine("It WILL display an image if one has been assigned"); else Debug.WriteLine("It will NOT display an image"); if (tool.InstanceDisplaysText == true) Debug.WriteLine("It WILL display text if assigned"); else Debug.WriteLine("It will NOT display text"); Debug.WriteLine("Its Height is: " + tool.Height.ToString()); Debug.IndentLevel--; Debug.IndentLevel--; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2