using System;
namespace Gwen.Control
{
///
/// Text box with masked text.
///
///
/// This class doesn't prevent programatic access to the text in any way.
///
public class TextBoxPassword : TextBox
{
private String m_Mask;
private char m_MaskCharacter;
///
/// Character used in place of actual characters for display.
///
public char MaskCharacter { get { return m_MaskCharacter; } set { m_MaskCharacter = value; } }
///
/// Initializes a new instance of the class.
///
/// Parent control.
public TextBoxPassword(Base parent)
: base(parent)
{
m_MaskCharacter = '*';
}
///
/// Handler for text changed event.
///
protected override void OnTextChanged()
{
m_Mask = new string(MaskCharacter, Text.Length);
TextOverride = m_Mask;
base.OnTextChanged();
}
}
}