本文整理汇总了C#中System.Windows.Controls.PasswordBox.SelectAll方法的典型用法代码示例。如果您正苦于以下问题:C# PasswordBox.SelectAll方法的具体用法?C# PasswordBox.SelectAll怎么用?C# PasswordBox.SelectAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.PasswordBox
的用法示例。
在下文中一共展示了PasswordBox.SelectAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkSetting
bool checkSetting(bool result, PasswordBox passwordBox, string message)
{
if (!result) {
MessageBox.Show(message, resources["Connect"] as string, MessageBoxButton.OK, MessageBoxImage.Warning);
passwordBox.SelectAll();
passwordBox.Focus();
}
return result;
}
示例2: SetSelection
private void SetSelection(PasswordBox passwordBox, int start, int length)
{
try
{
if (start < 0x0)
{
start = passwordBox.Password.Length;
}
passwordBox.GetType().GetMethod("Select", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(passwordBox, new object[] { start, length });
}
catch (Exception exception)
{
DebugLog.Assert(false, exception.Message);
passwordBox.SelectAll();
}
}
示例3: bindTextBox
public static void bindTextBox(PasswordBox passwordBox, string name)
{
passwordBox.Password = settings[name] as string;
passwordBox.PasswordChanged += (sender, e) => {
settings[name] = passwordBox.Password;
};
passwordBox.GotFocus += (sender, e) => {
passwordBox.SelectAll();
};
}
示例4: bindTextBox
public static void bindTextBox(PasswordBox passwordBox, string name) {
passwordBox.Password = settings[name] as string;
passwordBox.PasswordChanged += (sender, e) => {
var password = passwordBox.Password;
if (settings[name] as string != password) {
settings[name] = password;
}
};
settings.PropertyChanged += (sender, e) => {
if (e.PropertyName == name) {
var password = settings[name] as string;
if (passwordBox.Password != password) {
passwordBox.Password = password;
}
}
};
passwordBox.GotFocus += (sender, e) => {
passwordBox.SelectAll();
};
}