I see that a PasswordBox control in WPF has the .PasswordChar value this updates the whole PasswordBox to be either a dot or which ever character of choice eg 'X'
What I was interested in seeing I could have different PasswordChar for each key input the user enters, eg
Enter Password: XekelXf2l31
So rather a mask of the same Char and mask made of random Chars or from an Array of my choosing.
I have tried this so far with no luck:
public static string pwString = "XekelXf2l31";
public static char[] pwChars = pwString.ToCharArray();
public int count = 0;
private void PWbox1_KeyUp(object sender, KeyEventArgs e)
{
if (count < pwChars.Length)
{
PWbox1.PasswordChar = pwChars[count];
count++;
}
else
{
count = 0;
PWbox1.PasswordChar = pwChars[count];
}
}
Will I just need to use a standard TextBox?