반응형
public static void SetSelection(this PasswordBox passwordBox, int start, int length)
{
    passwordBox.GetType().GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(passwordBox, new object[] { start, length });
}
 
public static void FocusToEnd(this PasswordBox passwordBox)
{
    SetSelection(passwordBox, passwordBox.Password.Length, 0);
 
    passwordBox.Focus();
}
반응형

+ Recent posts