Version

LabelTool Class

Represents a label which displays text. The label is for display only and does not respond to clicks.
Syntax
'Declaration
 
Public Class LabelTool 
   Inherits ToolBase
   Implements Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.Notifications.INotificationBadgeProvider, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner 
public class LabelTool : ToolBase, Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.Notifications.INotificationBadgeProvider, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner  
Remarks

All LabelTool instance within a menu can be made to appear as headers to section off the tools beneath them. This can be accomplished by setting the LabelDisplayStyle property of the Settings on the PopupMenuTool or ApplicationMenuArea to Header. To make all LabelTool instances display as headers by default, set the LabelDisplayStyle property of the UltraToolbarsManager.MenuSettings to Header.

Example
The following code creates a toolbar, LabelTool and ComboBoxTool and places the label and combobox on the toolbar.

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

	Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click

		' ----------------------------------------------------------------------------
		' Create a toolbars and add it to the UltraToolbarManager's toolbars collection.
		Me.UltraToolbarsManager1.Toolbars.AddToolbar("GreatComposers")


		' ----------------------------------------------------------------------------
		' Create a ComboBoxTool and LabelTool and add them to the toolbar.
		Dim comboBoxTool As New ComboBoxTool("GreatComposersList")
		Dim labelTool As New LabelTool("GreatComposersLabel")

		' Always add new tools to the UltraToolbarManager's root tools collection
		' before adding them to menus or toolbars.
		Me.UltraToolbarsManager1.Tools.AddRange(New ToolBase() {comboBoxTool, labelTool})

		' Add the tools to the toolbar.
		Me.UltraToolbarsManager1.Toolbars("GreatComposers").Tools.AddTool("GreatComposersLabel")
		Me.UltraToolbarsManager1.Toolbars("GreatComposers").Tools.AddTool("GreatComposersList")


		' ----------------------------------------------------------------------------
		' Set the label's caption and right-justify the text.
		LabelTool.SharedProps.Caption = "Select Composer"
		LabelTool.SharedProps.AppearancesSmall.Appearance.FontData.Bold = DefaultableBoolean.True
		LabelTool.SharedProps.AppearancesSmall.Appearance.TextHAlign = HAlign.Right


		' ----------------------------------------------------------------------------
		' Add some entries to the combobox.
		comboBoxTool.ValueList.ValueListItems.Add("Mozart")
		comboBoxTool.ValueList.ValueListItems.Add("Beethoven")
		comboBoxTool.ValueList.ValueListItems.Add("Bach")
		comboBoxTool.ValueList.ValueListItems.Add("Vivaldi")
		comboBoxTool.SelectedIndex = 0
		comboBoxTool.DropDownStyle = DropDownStyle.DropDown
		comboBoxTool.Value = "<Select a comnposer>"
		comboBoxTool.SharedProps.ToolTipText = "Great Composers"
		comboBoxTool.AutoComplete = True

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

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

			// ----------------------------------------------------------------------------
			// Create a toolbars and add it to the UltraToolbarManager's toolbars collection.
			this.ultraToolbarsManager1.Toolbars.AddToolbar("GreatComposers");


			// ----------------------------------------------------------------------------
			// Create a ComboBoxTool and LabelTool and add them to the toolbar.
			ComboBoxTool comboBoxTool	= new ComboBoxTool("GreatComposersList");
			LabelTool	 labelTool		= new LabelTool("GreatComposersLabel");

			// Always add new tools to the UltraToolbarManager's root tools collection
			// before adding them to menus or toolbars.
			this.ultraToolbarsManager1.Tools.AddRange(new ToolBase [] { comboBoxTool, labelTool } );

			// Add the tools to the toolbar.
			this.ultraToolbarsManager1.Toolbars["GreatComposers"].Tools.AddTool("GreatComposersLabel");
			this.ultraToolbarsManager1.Toolbars["GreatComposers"].Tools.AddTool("GreatComposersList");


			// ----------------------------------------------------------------------------
			// Set the label's caption and right-justify the text.
			labelTool.SharedProps.Caption	= "Select Composer";
			labelTool.SharedProps.AppearancesSmall.Appearance.FontData.Bold = DefaultableBoolean.True;
			labelTool.SharedProps.AppearancesSmall.Appearance.TextHAlign	= HAlign.Right;


			// ----------------------------------------------------------------------------
			// Add some entries to the combobox and set some properties.
			comboBoxTool.ValueList.ValueListItems.Add("Mozart");
			comboBoxTool.ValueList.ValueListItems.Add("Beethoven");
			comboBoxTool.ValueList.ValueListItems.Add("Bach");
			comboBoxTool.ValueList.ValueListItems.Add("Vivaldi");
			comboBoxTool.SelectedIndex		= 0;
			comboBoxTool.DropDownStyle		= DropDownStyle.DropDownList;
			comboBoxTool.Value			= "<Select a comnposer>";
			comboBoxTool.SharedProps.ToolTipText	= "Great Composers";
			comboBoxTool.AutoComplete		= true;

		}
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