The PasswordChar property is used when you want the TextBoxTool to obscure the text entered by the end-user. The character specified for this property will be displayed in place of the alphanumeric characters typed by the user. Common password characters are the asterisk ("*") and the bullet symbol ("•", ASCII character 149).
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; }
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