Version

ParentCollection Property (ToolBase)

The ToolsCollectionBase that owns this ToolBase.
Syntax
'Declaration
 
Public ReadOnly Property ParentCollection As ToolsCollectionBase
public ToolsCollectionBase ParentCollection {get;}
Remarks

Use this property to access the collection containing this object.

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

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


		' Tool owner properties
		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() + "'");


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


			// Tool owner properties
			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--;

		}
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