Version

TextBoxTool Class

Represents a text box, which can be edited by the end-user.
Syntax
'Declaration
 
Public Class TextBoxTool 
   Inherits TextEditorToolBase
   Implements Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.Notifications.INotificationBadgeProvider, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner 
public class TextBoxTool : TextEditorToolBase, Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.Notifications.INotificationBadgeProvider, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner  
Remarks

To be notified when an instance of the TextBoxTool has its Text changed, handle the ToolValueChanged event of the TextBoxTool. To be notified when any instance of all TextBoxTools with the same Key has its Text changed, handle the UltraToolbarsManager.ToolValueChanged event and check the Key of the tool passed into the event arguments.

Example
The following code creates a toolbar, LabelTool and TextBoxTool and places the label and textbox on the toolbar.

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

	Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click

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


		' ----------------------------------------------------------------------------
		' Create a TextBoxTool and LabelTool and add them to the toolbar.
		Dim textBoxTool As New TextBoxTool("PasswordTextBox")
		Dim labelTool As New LabelTool("PasswordLabel")

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

		' Add the tools to the toolbar.
		Me.UltraToolbarsManager1.Toolbars("Password").Tools.AddTool("PasswordLabel")
		Me.UltraToolbarsManager1.Toolbars("Password").Tools.AddTool("PasswordTextBox")


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


		' ----------------------------------------------------------------------------
		' Set the textbox up for password entry
		textBoxTool.PasswordChar = "*"
		textBoxTool.MaxLength = 10
		textBoxTool.Locked = False
		textBoxTool.Text = "password"
		textBoxTool.VerticalDisplayStyle = VerticalDisplayStyle.ShowAsButton
		textBoxTool.EditAppearance.FontData.Bold = DefaultableBoolean.True

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

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

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


			// ----------------------------------------------------------------------------
			// Create a TextBoxTool and LabelTool and add them to the toolbar.
			TextBoxTool	textBoxTool	= new TextBoxTool("PasswordTextBox");
			LabelTool	labelTool	= new LabelTool("PasswordLabel");

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

			// Add the tools to the toolbar.
			this.ultraToolbarsManager1.Toolbars["Password"].Tools.AddTool("PasswordLabel");
			this.ultraToolbarsManager1.Toolbars["Password"].Tools.AddTool("PasswordTextBox");


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


			// ----------------------------------------------------------------------------
			// Set the textbox up for password entry
			textBoxTool.PasswordChar		= "*";
			textBoxTool.MaxLength		= 10;
			textBoxTool.Locked		= false;
			textBoxTool.Text			= "password";
			textBoxTool.VerticalDisplayStyle	= VerticalDisplayStyle.ShowAsButton;
			textBoxTool.EditAppearance.FontData.Bold	= DefaultableBoolean.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