Пример #1
0
 private void PasswordTextBox_Enter(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SignInButton.Focus();
     }
 }
Пример #2
0
 private void Reset()
 {
     user.Text     = "";
     pass.Password = "";
     SignInButton.Focus();
     InvalidLogin.Visibility = Visibility.Hidden;
 }
Пример #3
0
 private void PasswordControl_KeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key == VirtualKey.Enter)
     {
         SignInButton.Focus(FocusState.Programmatic);
         PasswordControl.Focus(FocusState.Programmatic);
         SignInButton_Click(sender, e);
     }
 }
Пример #4
0
 /// <summary>
 /// used for handling key down event for focusing elements in serial
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Elements_KeyDown(object sender, KeyEventArgs e)
 {
     if (sender is TextBox)
     {
         if (IsTabKeyDown(e))
         {
             if (IsShiftKeyDown())
             {
                 BtnClose.Focus();
             }
             else
             if (GlobalPasswordTextBox != null)
             {
                 GlobalPasswordTextBox.Focus();
             }
         }
     }
     else if (sender is PasswordBox)
     {
         if (IsTabKeyDown(e))
         {
             if (IsShiftKeyDown())
             {
                 EmailTextBox.Focus();
             }
             else
             {
                 SignInButton.Focus();
             }
         }
     }
     else if (sender is Button)
     {
         var button = sender as Button;
         if (button.Name == "SignInButton")
         {
             if (IsTabKeyDown(e))
             {
                 if (IsShiftKeyDown())
                 {
                     if (GlobalPasswordTextBox != null)
                     {
                         GlobalPasswordTextBox.Focus();
                     }
                     else
                     {
                         hyperlinkSignUp.Focus();
                     }
                 }
             }
         }
         else
         {
             if (IsTabKeyDown(e))
             {
                 if (IsShiftKeyDown())
                 {
                     hyperlinkSignUp.Focus();
                 }
                 else
                 {
                     EmailTextBox.Focus();
                 }
             }
         }
     }
     else if (sender is System.Windows.Documents.Hyperlink)
     {
         if (IsTabKeyDown(e))
         {
             if (IsShiftKeyDown())
             {
                 SignInButton.Focus();
             }
             else
             {
                 BtnClose.Focus();
             }
         }
     }
 }