Version

Appearance Property (ToolAppearances)

Gets or sets the default appearance of the tool.
Syntax
'Declaration
 
Public Property Appearance As Infragistics.Win.AppearanceBase
public Infragistics.Win.AppearanceBase Appearance {get; set;}

Property Value

The default appearance of the tool.
Remarks

The Appearance property of an object is used to associate the object with an Appearance object that will determine its appearance. The Appearance object has properties that control settings such as color, borders, font, transparency, etc. For many of the objects in UltraWinToolbars, you do not set formatting properties directly. Instead, you set the properties of an Appearance object, which controls the formatting of the object it is attached to.

Note that the properties of an Appearance object can also operate in a hierarchical fashion. Certain properties can be set to a "use default" value, which indicates to the control that the property should take its setting from the object's parent. This functionality is enabled by default, so that unless you specify otherwise, child objects resemble their parents, and formatting set at higher levels of the control hierarchy is inherited by objects lower in the hierarchy.

Example
The following code sets a default forecolor and backcolor for all tools and then overrides the forecolor and backcolor for all instances of a specific tool.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolbars

	Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click

		' Set the default backcolor and forecolor for all tool appearances.
		Dim tool As ToolBase
		For Each tool In Me.UltraToolbarsManager1.Tools
			tool.SharedProps.AppearancesSmall.Appearance.BackColor = Color.LightBlue
			tool.SharedProps.AppearancesSmall.Appearance.ForeColor = Color.DarkBlue

			tool.SharedProps.AppearancesLarge.Appearance.BackColor = Color.LightBlue
			tool.SharedProps.AppearancesLarge.Appearance.ForeColor = Color.DarkBlue

			' NOTE: You can also set defaults for the other appearances off of the
			' AppearancesLarge and AppearancesSmall properties, i.e.:
			'		AppearanceOnMenu
			'		AppearanceOnToolbar
			'		HotTrackAppearance
			'		HotTrackAppearanceOnMenu
			'		HotTrackAppearanceOnToolbar
			'		PressedAppearance
			'		PressedAppearanceOnMenu
			'		PressedAppearanceOnToolbar
		Next


		' Override the default backcolor and forecolor settings for all instances of the 
		' tool with the key of 'AlignLeft'.  
		For Each tool In Me.UltraToolbarsManager1.Tools
			If tool.Key = "AlignLeft" Then
				Dim toolInstance As ToolBase
				For Each toolInstance In tool.SharedProps.ToolInstances
					toolInstance.InstanceProps.AppearancesSmall.Appearance.BackColor = Color.LightGreen
					toolInstance.InstanceProps.AppearancesSmall.Appearance.ForeColor = Color.DarkGreen

					toolInstance.InstanceProps.AppearancesLarge.Appearance.BackColor = Color.LightGreen
					toolInstance.InstanceProps.AppearancesLarge.Appearance.ForeColor = Color.DarkGreen

					' NOTE: You can also override defaults for the other appearances off of the
					' AppearancesLarge and AppearancesSmall properties, i.e.:
					'		AppearanceOnMenu
					'		AppearanceOnToolbar
					'		HotTrackAppearance
					'		HotTrackAppearanceOnMenu
					'		HotTrackAppearanceOnToolbar
					'		PressedAppearance
					'		PressedAppearanceOnMenu
					'		PressedAppearanceOnToolbar
				Next

				Exit For
			End If
		Next

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinToolbars;

		private void button23_Click(object sender, System.EventArgs e)
		{

			// Set the default backcolor and forecolor for all tool appearances.
			foreach(ToolBase tool in this.ultraToolbarsManager1.Tools)
			{
				tool.SharedProps.AppearancesSmall.Appearance.BackColor = Color.LightBlue;
				tool.SharedProps.AppearancesSmall.Appearance.ForeColor = Color.DarkBlue;

				tool.SharedProps.AppearancesLarge.Appearance.BackColor = Color.LightBlue;
				tool.SharedProps.AppearancesLarge.Appearance.ForeColor = Color.DarkBlue;

				// NOTE: You can also set defaults for the other appearances off of the
				// AppearancesLarge and AppearancesSmall properties, i.e.:
				//		AppearanceOnMenu
				//		AppearanceOnToolbar
				//		HotTrackAppearance
				//		HotTrackAppearanceOnMenu
				//		HotTrackAppearanceOnToolbar
				//		PressedAppearance
				//		PressedAppearanceOnMenu
				//		PressedAppearanceOnToolbar
			}


			// Override the default backcolor and forecolor settings for all instances of the 
			// tool with the key of 'AlignLeft'.  
			foreach(ToolBase tool in this.ultraToolbarsManager1.Tools)
			{
				if (tool.Key == "AlignLeft")
				{
					foreach(ToolBase toolInstance in tool.SharedProps.ToolInstances)
					{
						toolInstance.InstanceProps.AppearancesSmall.Appearance.BackColor = Color.LightGreen;
						toolInstance.InstanceProps.AppearancesSmall.Appearance.ForeColor = Color.DarkGreen;

						toolInstance.InstanceProps.AppearancesLarge.Appearance.BackColor = Color.LightGreen;
						toolInstance.InstanceProps.AppearancesLarge.Appearance.ForeColor = Color.DarkGreen;

						// NOTE: You can also override defaults for the other appearances off of the
						// AppearancesLarge and AppearancesSmall properties, i.e.:
						//		AppearanceOnMenu
						//		AppearanceOnToolbar
						//		HotTrackAppearance
						//		HotTrackAppearanceOnMenu
						//		HotTrackAppearanceOnToolbar
						//		PressedAppearance
						//		PressedAppearanceOnMenu
						//		PressedAppearanceOnToolbar
					}

					break;
				}
			}

		}
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