本文整理汇总了C#中System.Windows.Controls.PasswordBox.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# PasswordBox.Focus方法的具体用法?C# PasswordBox.Focus怎么用?C# PasswordBox.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.PasswordBox
的用法示例。
在下文中一共展示了PasswordBox.Focus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_pswb = (PasswordBox)GetTemplateChild("pswb");
if (_pswb != null)
{
_pswb.Focus();
}
_pswb = (PasswordBox)GetTemplateChild("pswb");
}
示例3: CheckTextBox
public bool CheckTextBox(PasswordBox box)
{
if (box.Password.Length == 0)
{
MessageBox.Show("Вы ввели не все данные.");
box.Focus();
return false;
}
return true;
}
示例4: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_pswbOld = (PasswordBox)GetTemplateChild("pswbOld");
if (_pswbOld != null)
{
_pswbOld.Focus();
}
_pswbNew = (PasswordBox)GetTemplateChild("pswbNew");
}
示例5: SparkleSetup
//.........这里部分代码省略.........
Canvas.SetTop (email_box, 230);
Buttons.Add (cancel_button);
Buttons.Add (continue_button);
Controller.UpdateSetupContinueButtonEvent += delegate (bool enabled) {
Dispatcher.BeginInvoke ((Action) delegate {
continue_button.IsEnabled = enabled;
});
};
name_box.TextChanged += delegate {
Controller.CheckSetupPage (name_box.Text, email_box.Text);
};
email_box.TextChanged += delegate {
Controller.CheckSetupPage (name_box.Text, email_box.Text);
};
cancel_button.Click += delegate {
Dispatcher.BeginInvoke ((Action) delegate {
Program.UI.StatusIcon.Dispose ();
Controller.SetupPageCancelled ();
});
};
continue_button.Click += delegate {
Controller.SetupPageCompleted (name_box.Text, email_box.Text);
};
Controller.CheckSetupPage (name_box.Text, email_box.Text);
if (name_box.Text.Equals (""))
name_box.Focus ();
else
email_box.Focus ();
break;
}
case PageType.Invite: {
Header = "You’ve received an invite!";
Description = "Do you want to add this project to SparkleShare?";
TextBlock address_label = new TextBlock () {
Text = "Address:",
Width = 150,
TextAlignment = TextAlignment.Right
};
TextBlock address_value = new TextBlock () {
Text = Controller.PendingInvite.Address,
Width = 175,
FontWeight = FontWeights.Bold
};
TextBlock path_label = new TextBlock () {
Text = "Remote Path:",
Width = 150,
TextAlignment = TextAlignment.Right
};
TextBlock path_value = new TextBlock () {
Width = 175,
示例6: addInputType
private void addInputType(InputType inputType)
{
if (inputType.Type == InputType.INPUT_TYPE_PASSWORD)
{
PasswordBox passwordBox = new PasswordBox();
passwordBox.Password = inputType.Value;
ContentPanel.Children.Add(passwordBox);
passwordBox.Focus();
passwordBox.LostFocus += new RoutedEventHandler(TextChanged_Clicked);
passwordBox.KeyDown += OnKeyDownHandler;
} else if (inputType.Type == InputType.INPUT_TYPE_DATE)
{
DatePicker datePicker = new DatePicker();
datePicker.Header = inputType.Name;
datePicker.Value = toDateTime(inputType.Value);
ContentPanel.Children.Add(datePicker);
datePicker.Focus();
datePicker.ValueChanged += Date_Changed;
} else
{
TextBox textBox = new TextBox();
textBox.Text = inputType.Value;
InputScope Keyboard = new InputScope();
InputScopeName ScopeName = new InputScopeName();
switch (inputType.Type)
{
case InputType.INPUT_TYPE_DATE:
ScopeName.NameValue = InputScopeNameValue.Date;
break;
case InputType.INPUT_TYPE_AMOUNT:
ScopeName.NameValue = InputScopeNameValue.CurrencyAmount;
break;
case InputType.INPUT_TYPE_EMAIL:
ScopeName.NameValue = InputScopeNameValue.EmailUserName;
break;
case InputType.INPUT_TYPE_NUMBER:
ScopeName.NameValue = InputScopeNameValue.Number;
break;
case InputType.INPUT_TYPE_PASSWORD:
ScopeName.NameValue = InputScopeNameValue.Password;
break;
case InputType.INPUT_TYPE_PHONE:
ScopeName.NameValue = InputScopeNameValue.TelephoneNumber;
break;
case InputType.INPUT_TYPE_URL:
ScopeName.NameValue = InputScopeNameValue.Url;
break;
case InputType.INPUT_TYPE_STRING:
ScopeName.NameValue = InputScopeNameValue.Text;
break;
}
Keyboard.Names.Add(ScopeName);
textBox.InputScope = Keyboard;
ContentPanel.Children.Add(textBox);
textBox.Focus();
textBox.LostFocus += new RoutedEventHandler(TextChanged_Clicked);
textBox.KeyDown += OnKeyDownHandler;
}
}