• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadPasswordBox

This class represents a control that is designed for entering passwords. It can show different content when empty and provides a button that displays the currently entered password.

Inheritance
System.Object
RadWatermarkTextBox
RadPasswordBox
Inherited Members
RadWatermarkTextBox.LabelProperty
RadWatermarkTextBox.LabelStyleProperty
RadWatermarkTextBox.KeepLabelFloatedProperty
RadWatermarkTextBox.HasLabelProperty
RadWatermarkTextBox.IsLabelFloatedProperty
RadWatermarkTextBox.WatermarkTemplateProperty
RadWatermarkTextBox.WatermarkContentProperty
RadWatermarkTextBox.CurrentTextProperty
RadWatermarkTextBox.SelectionOnFocusProperty
RadWatermarkTextBox.WatermarkBehaviorProperty
RadWatermarkTextBox.ReadOnlyBackgroundProperty
RadWatermarkTextBox.DisabledBackgroundProperty
RadWatermarkTextBox.AdditionalContentProperty
RadWatermarkTextBox.AdditionalContentTemplateProperty
RadWatermarkTextBox.IsWatermarkVisibleProperty
RadWatermarkTextBox.OnPropertyChanged(DependencyPropertyChangedEventArgs)
RadWatermarkTextBox.OnInitialized(EventArgs)
RadWatermarkTextBox.EndInit()
RadWatermarkTextBox.Label
RadWatermarkTextBox.LabelStyle
RadWatermarkTextBox.KeepLabelFloated
RadWatermarkTextBox.HasLabel
RadWatermarkTextBox.IsLabelFloated
RadWatermarkTextBox.WatermarkContent
RadWatermarkTextBox.WatermarkTemplate
RadWatermarkTextBox.CurrentText
RadWatermarkTextBox.IsWatermarkVisible
RadWatermarkTextBox.WatermarkBehavior
RadWatermarkTextBox.ReadOnlyBackground
RadWatermarkTextBox.DisabledBackground
RadWatermarkTextBox.SelectionOnFocus
RadWatermarkTextBox.AdditionalContent
RadWatermarkTextBox.AdditionalContentTemplate
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll

Syntax

[TelerikToolboxCategory("Input")]
public class RadPasswordBox : RadWatermarkTextBox, IThemable

Constructors

RadPasswordBox()

Initializes a new instance of the RadPasswordBox class.

Declaration
public RadPasswordBox()

Fields

IsPasswordVisibleProperty

Identifies the IsPasswordVisible dependency property.

Declaration
public static readonly DependencyProperty IsPasswordVisibleProperty
Field Value
System.Windows.DependencyProperty

PasswordChangedEvent

Identifies the PasswordChanged routed event.

Declaration
public static readonly RoutedEvent PasswordChangedEvent
Field Value
System.Windows.RoutedEvent

PasswordCharProperty

Identifies the PasswordChar dependency property.

Declaration
public static readonly DependencyProperty PasswordCharProperty
Field Value
System.Windows.DependencyProperty

ShowPasswordButtonContentProperty

Identifies the ShowPasswordButtonContent dependency property.

Declaration
public static readonly DependencyProperty ShowPasswordButtonContentProperty
Field Value
System.Windows.DependencyProperty

ShowPasswordButtonContentTemplateProperty

Identifies the ShowPasswordButtonContentTemplate dependency property.

Declaration
public static readonly DependencyProperty ShowPasswordButtonContentTemplateProperty
Field Value
System.Windows.DependencyProperty

ShowPasswordButtonVisibilityProperty

Identifies the ShowPasswordButtonVisibility dependency property.

Declaration
public static readonly DependencyProperty ShowPasswordButtonVisibilityProperty
Field Value
System.Windows.DependencyProperty

Properties

IsPasswordVisible

Gets value indicating whether the actual password is currently displayed.

Declaration
public bool IsPasswordVisible { get; }
Property Value
System.Boolean

Password

Gets or sets the current password as a string representation.

Declaration
public string Password
{
    [SecurityCritical]
    get;
    [SecurityCritical]
    set;
}
Property Value
System.String

PasswordChar

Gets or sets the masking character for RadPasswordBox. The default value is a bullet character (●).

Declaration
public char PasswordChar { get; set; }
Property Value
System.Char

SecurePassword

Gets the current password as a System.Security.SecureString.

Declaration
public SecureString SecurePassword { get; }
Property Value
System.Security.SecureString

ShowPasswordButtonContent

Gets or sets the content to be shown in the button used to display the password at runtime.

Declaration
public object ShowPasswordButtonContent { get; set; }
Property Value
System.Object

ShowPasswordButtonContentTemplate

Gets or sets the template for presenting the content in the button used to display the password at runtime.

Declaration
public DataTemplate ShowPasswordButtonContentTemplate { get; set; }
Property Value
System.Windows.DataTemplate

ShowPasswordButtonVisibility

Gets or sets value indicating whether the button used to display the password should be visible. The default value is Auto.

Declaration
public ShowPasswordButtonVisibilityMode ShowPasswordButtonVisibility { get; set; }
Property Value
ShowPasswordButtonVisibilityMode

Methods

Clear()

Clears the current Password.

Declaration
public void Clear()

HandleClear()

Called when the Clear command is invoked.

Declaration
protected override void HandleClear()
Overrides
RadWatermarkTextBox.HandleClear()

HandleKeyDown(Key)

Contains the logic for handling the preview key down event of RadPasswordBox.

Declaration
protected virtual bool HandleKeyDown(Key key)
Parameters
System.Windows.Input.Key key

The key that has been pressed.

Returns
System.Boolean

True if the KeyDown event should be handled, otherwise false.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the System.Windows.FrameworkElement-derived class.

Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
System.Windows.Size constraint

A maximum System.Windows.Size to not exceed.

Returns
System.Windows.Size

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.

Declaration
public override void OnApplyTemplate()
Overrides
RadWatermarkTextBox.OnApplyTemplate()

OnCreateAutomationPeer()

Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer

Overrides
RadWatermarkTextBox.OnCreateAutomationPeer()

OnDrop(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

Declaration
protected override void OnDrop(DragEventArgs e)
Parameters
System.Windows.DragEventArgs e

The System.Windows.DragEventArgs that contains the event data.

OnPasswordChanged()

Called when the Password changes and raises the PasswordChanged event.

Declaration
protected virtual void OnPasswordChanged()

OnPreviewKeyDown(KeyEventArgs)

Virtual method reporting a key was pressed.

Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
System.Windows.Input.KeyEventArgs e

OnPreviewTextInput(TextCompositionEventArgs)

Virtual method reporting text composition.

Declaration
protected override void OnPreviewTextInput(TextCompositionEventArgs e)
Parameters
System.Windows.Input.TextCompositionEventArgs e

Events

PasswordChanged

Occurs when the value of the Password property changes.

Declaration
[SRCategory("Behavior")]
public event RoutedEventHandler PasswordChanged
Event Type
System.Windows.RoutedEventHandler

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.