Version

IsRootTool Property

Returns whether the ToolBase is a root ToolBase (i.e., is in the UltraToolbarsManager component's UltraToolbarsManager.Tools collection).
Syntax
'Declaration
 
Public ReadOnly Property IsRootTool As Boolean
public bool IsRootTool {get;}
Remarks

UltraWinToolbars represents a tool in two ways, as a root tool and an instance tool. Root tools are the tools that appear in the run-time customizer; their purpose is to create the tools that will appear on a toolbar or menu. Instance tools are the tools that the user actually interacts with; they appear on toolbars and/or menus. Each instance tool is related to exactly one root tool. Each root tool may have multiple instance tools derived from it. For example, a "FileSave" root tool may have two instance tools in an application - one displaying only text and appearing on the File menu, and one displaying only an image and appearing on the Standard toolbar.

Although functionally treated as distinct objects, root and instance tools share a close relationship. Changes made to a root tool will affect all instance tools derived from that root. Changes to an instance tool may affect only the one instance, or they may affect the root tool and by extension other instances of that root.

For a complete discussion of the difference between root and instance tools, see the following section of the help: Developer’s Guide > The Toolset > Controls and Components > WinToolbarsManager > Understanding WinToolbarsManager.

This property will return True for a root tool, False for an instance tool.

Example
The following code demonstrates how to access some of the information passed in the event arguments of the ToolClick event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

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() + "'")


		' Display property information for the tool that was clicked.
		Debug.IndentLevel += 1


		Debug.WriteLine("AllowMultipleInstancesResolved: " + e.Tool.AllowMultipleInstancesResolved.ToString())
		Debug.WriteLine("CaptionResolved: '" + e.Tool.CaptionResolved + "',  SharedProps.Caption: '" + e.Tool.SharedProps.Caption)
		Debug.WriteLine("CustomizerCaptionResolved: '" + e.Tool.CustomizerCaptionResolved + "',  SharedProps.CustomizerCaption: '" + e.Tool.SharedProps.CustomizerCaption)
		Debug.WriteLine("CustomizerDescriptionResolved: '" + e.Tool.CustomizerDescriptionResolved + "',  SharedProps.CustomizerDescription: '" + e.Tool.SharedProps.CustomizerDescription)
		Debug.WriteLine("DisplayStyleResolved: '" + e.Tool.DisplayStyleResolved.ToString() + "',  SharedProps.DisplayStyle: '" + e.Tool.SharedProps.DisplayStyle.ToString())
		Debug.WriteLine("DefaultSize: '" + e.Tool.DefaultSize.ToString() + ", Actual Width: " + e.Tool.WidthResolved.ToString() + ", Actual Height: " + e.Tool.Height.ToString())
		Debug.WriteLine("EnabledResolved: '" + e.Tool.EnabledResolved.ToString())
		Debug.WriteLine("Tool '" + e.Tool.Key + "' has an Index in its parent collection of: " + e.Tool.Index.ToString())
		Debug.WriteLine("IsActiveTool: " + e.Tool.IsActiveTool.ToString())

		If Not e.Tool.InstanceProps Is Nothing Then
			Debug.WriteLine("IsFirstInGroupResolved: '" + e.Tool.IsFirstInGroupResolved.ToString() + "',  InstanceProps.IsFirstInGroup: '" + e.Tool.InstanceProps.IsFirstInGroup.ToString())
		End If

		Debug.WriteLine("IsRootTool: " + e.Tool.IsRootTool.ToString())
		Debug.WriteLine("MaxWidthResolved: " + e.Tool.MaxWidthResolved.ToString())
		Debug.WriteLine("MinWidthResolved: " + e.Tool.MinWidthResolved.ToString())
		Debug.WriteLine("MinimumSize: " + e.Tool.MinimumSize.ToString())
		Debug.WriteLine("OwnerIsNull: " + e.Tool.OwnerIsNull.ToString())

		If Not e.Tool.InstanceProps Is Nothing Then
			Debug.WriteLine("RecentlyUsedResolved: '" + e.Tool.RecentlyUsedResolved.ToString() + "',  InstanceProps.RecentlyUsed: '" + e.Tool.InstanceProps.RecentlyUsed.ToString())
		End If

		Debug.WriteLine("ShortcutResolved: '" + e.Tool.ShortcutResolved.ToString() + "',  SharedProps.Shortcut: '" + e.Tool.SharedProps.Shortcut.ToString())

		If Not e.Tool.InstanceProps Is Nothing Then
			Debug.WriteLine("SpringResolved: '" + e.Tool.SpringResolved.ToString() + "',  InstanceProps.Spring: '" + e.Tool.InstanceProps.Spring.ToString())
		End If

		Debug.WriteLine("The toolbar manager's Name property is set to: '" + e.Tool.ToolbarsManager.Site.Name)
		Debug.WriteLine("TooltipTextResolved: '" + e.Tool.ToolTipTextResolved + "',  SharedProps.TooltipText: '" + e.Tool.SharedProps.ToolTipText)

		If Not e.Tool.InstanceProps Is Nothing Then
			Debug.WriteLine("VisibleResolved: '" + e.Tool.VisibleResolved.ToString() + "',  InstanceProps.Visible: '" + e.Tool.InstanceProps.Visible.ToString())
		End If


		If Not e.Tool.InstanceProps Is Nothing Then
			Debug.WriteLine("WidthResolved: '" + e.Tool.WidthResolved.ToString() + "',  InstanceProps.Width: '" + e.Tool.InstanceProps.Width.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() + "'");


			// Display property information for the tool that was clicked.
			Debug.IndentLevel++;


			Debug.WriteLine("AllowMultipleInstancesResolved: " + e.Tool.AllowMultipleInstancesResolved.ToString());
			Debug.WriteLine("CaptionResolved: '" + e.Tool.CaptionResolved + "',  SharedProps.Caption: '" + e.Tool.SharedProps.Caption);
			Debug.WriteLine("CustomizerCaptionResolved: '" + e.Tool.CustomizerCaptionResolved + "',  SharedProps.CustomizerCaption: '" + e.Tool.SharedProps.CustomizerCaption);
			Debug.WriteLine("CustomizerDescriptionResolved: '" + e.Tool.CustomizerDescriptionResolved + "',  SharedProps.CustomizerDescription: '" + e.Tool.SharedProps.CustomizerDescription);
			Debug.WriteLine("DisplayStyleResolved: '" + e.Tool.DisplayStyleResolved.ToString() + "',  SharedProps.DisplayStyle: '" + e.Tool.SharedProps.DisplayStyle.ToString());
			Debug.WriteLine("DefaultSize: '" + e.Tool.DefaultSize.ToString() + ", Actual Width: " + e.Tool.WidthResolved.ToString() + ", Actual Height: " + e.Tool.Height.ToString());
			Debug.WriteLine("EnabledResolved: '" + e.Tool.EnabledResolved.ToString());
			Debug.WriteLine("Tool '" + e.Tool.Key + "' has an Index in its parent collection of: " + e.Tool.Index.ToString()); 
			Debug.WriteLine("IsActiveTool: " + e.Tool.IsActiveTool.ToString());

			if (e.Tool.InstanceProps != null)
				Debug.WriteLine("IsFirstInGroupResolved: '" + e.Tool.IsFirstInGroupResolved + "',  InstanceProps.IsFirstInGroup: '" + e.Tool.InstanceProps.IsFirstInGroup);

			Debug.WriteLine("IsRootTool: " + e.Tool.IsRootTool.ToString());
			Debug.WriteLine("MaxWidthResolved: " + e.Tool.MaxWidthResolved.ToString());
			Debug.WriteLine("MinWidthResolved: " + e.Tool.MinWidthResolved.ToString());
			Debug.WriteLine("MinimumSize: " + e.Tool.MinimumSize.ToString());
			Debug.WriteLine("OwnerIsNull: " + e.Tool.OwnerIsNull.ToString());

			if (e.Tool.InstanceProps != null)
				Debug.WriteLine("RecentlyUsedResolved: '" + e.Tool.RecentlyUsedResolved + "',  InstanceProps.RecentlyUsed: '" + e.Tool.InstanceProps.RecentlyUsed);

			Debug.WriteLine("ShortcutResolved: '" + e.Tool.ShortcutResolved + "',  SharedProps.Shortcut: '" + e.Tool.SharedProps.Shortcut);

			if (e.Tool.InstanceProps != null)
				Debug.WriteLine("SpringResolved: '" + e.Tool.SpringResolved + "',  InstanceProps.Spring: '" + e.Tool.InstanceProps.Spring);

			Debug.WriteLine("The toolbar manager's Name property is set to: '" + e.Tool.ToolbarsManager.Site.Name);
			Debug.WriteLine("TooltipTextResolved: '" + e.Tool.ToolTipTextResolved + "',  SharedProps.TooltipText: '" + e.Tool.SharedProps.ToolTipText);

			if (e.Tool.InstanceProps != null)
				Debug.WriteLine("VisibleResolved: '" + e.Tool.VisibleResolved + "',  InstanceProps.Visible: '" + e.Tool.InstanceProps.Visible);
			
			if (e.Tool.InstanceProps != null)
				Debug.WriteLine("WidthResolved: '" + e.Tool.WidthResolved + "',  InstanceProps.Width: '" + e.Tool.InstanceProps.Width);

			
			Debug.IndentLevel--;

		}
Requirements

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

See Also