Exemplo n.º 1
0
 private void Password_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == Convert.ToChar(Keys.Enter))
     {
         LoginButton.Focus();
     }
 }
Exemplo n.º 2
0
        private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Return || e.Key == Key.Enter)
            {
                if (UsernameInput.IsFocused)
                {
                    PasswordInput.Focus();
                }
                else if (PasswordInput.IsFocused)
                {
                    LoginButton.Focus();
                    SendKeys.SendWait("{Enter}");
                }
            }

            else
            {
                if (System.Windows.Forms.Control.IsKeyLocked(Keys.CapsLock))
                {
                    CapsCheck.Visibility = Visibility.Visible;
                    Jim.Background       = Brushes.Red;
                    Bob.Background       = Brushes.Green;
                }
                else
                {
                    // System.Windows.MessageBox.Show("The Caps Lock key is OFF.");
                    CapsCheck.Visibility = Visibility.Collapsed;
                    Jim.Background       = Brushes.DarkTurquoise;
                    Bob.Background       = Brushes.PaleVioletRed;
                }
            }
        }
 private void pass_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         LoginButton.Focus();
     }
 }
Exemplo n.º 4
0
 private void PasswordTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if ((e.KeyCode == Keys.Enter))
     {
         LoginButton.Focus();
     }
 }
Exemplo n.º 5
0
        async void OnIndexChange(object sender, EventArgs e)
        {
//            var picker = (Picker)sender;
//            await Navigation.PushAsync(new MainPage(picker.SelectedIndex + 1));
//            picker.Unfocus();
            LoginButton.Focus();
        }
Exemplo n.º 6
0
 private void PasswordTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key.Equals(Windows.System.VirtualKey.Enter))
     {
         LoginButton.Focus(FocusState.Programmatic);
     }
 }
Exemplo n.º 7
0
 private void PasswordBox_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Return)
     {
         LoginButton.Focus();
     }
 }
Exemplo n.º 8
0
 private void LoginButton_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         LoginButton.Focus();
     }
 }
Exemplo n.º 9
0
 public LoginPage()
 {
     InitializeComponent();
     EmailEntry.Completed    += (sender, args) => { PasswordEntry.Focus(); };
     PasswordEntry.Completed += (sender, args) => { LoginButton.Focus(); };
     //this.AnimationView.IsVisible = false;
     //this.LoginButton.Clicked += LoginButton_Clicked;
 }
Exemplo n.º 10
0
 private void ShowPassword_MouseLeave(object sender, MouseEventArgs e)
 {
     ShowPasswordLabel.Text       = "";
     ShowPasswordLabel.Visibility = Visibility.Hidden;
     PasswordTB.Password          = password;
     LoginButton.Focus();
     PasswordTB.IsEnabled = true;
 }
Exemplo n.º 11
0
 private void PasswordKeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key == Windows.System.VirtualKey.Enter)
     {
         LoginButton.Focus(FocusState.Programmatic);
         LoginButton.Command.Execute(null);
     }
 }
Exemplo n.º 12
0
 private void Enter(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         LoginButton.Focus();
         ButtonLogin_Click(sender, null);
     }
 }
Exemplo n.º 13
0
 private void KeyTextBox_OnPreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         e.Handled = true;
         LoginButton.Focus();
         LoginButton.Command.Execute(null);
     }
 }
Exemplo n.º 14
0
 private void passTBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Enter)
     {
         // go to next form
     }
     if (e.KeyData == Keys.Tab)
     {
         // switch focus to login button
         LoginButton.Focus();
     }
 }
Exemplo n.º 15
0
 private void PasswordEntry_Completed(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(PasswordEntry.Text))
     {
         LoginButton.Focus();
     }
     else
     {
         //DependencyService.Get<IMessage>().LongAlert("Password is blank!");
         UserDialogs.Instance.ShowError("Password is blank!", 3000);
         PasswordEntry.Focus();
     }
 }
Exemplo n.º 16
0
        public LoginScreen()
        {
            InitializeComponent();

            Login.Completed += (object sender, EventArgs e) =>
            {
                Password.Focus();
            };
            Password.Completed += (object sender, EventArgs e) =>
            {
                LoginButton.Focus();
            };
        }
Exemplo n.º 17
0
 private void LoginWindow_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         LoginButton.Focus();
         var peer       = new ButtonAutomationPeer(LoginButton);
         var invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
         invokeProv?.Invoke();
     }
     else if (e.Key == Key.Escape)
     {
         Application.Current.Shutdown();
     }
 }
        private void TextBox_KeyUp(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                switch (((Control)sender).Name)
                {
                case "Token":
                    LoginButton.Focus(FocusState.Pointer);
                    LoginButton_Click(sender, null);
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 19
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            WindowToolTip.Opacity = 0;

            TextBlockSoftName.Text      = SoftResources.StringResouce.SoftName;
            TextBlockSoftVersion.Text   = UserClient.CurrentVersion.ToString();
            TextBlockSoftCopyright.Text = $"本软件著作权归{CommonLibrary.SoftResources.StringResouce.SoftCopyRight}所有";


            // 上次登录为7天以前则清除账户密码
            if ((DateTime.Now - UserClient.JsonSettings.LoginTime).TotalDays < UserClient.JsonSettings.PasswordOverdueDays)
            {
                //加载数据
                NameTextBox.Text     = UserClient.JsonSettings.LoginName ?? "";
                PasswordBox.Password = UserClient.JsonSettings.Password ?? "";
                Remember.IsChecked   = UserClient.JsonSettings.Password != "";
            }

            //初始化输入焦点
            if (UserClient.JsonSettings.Password != "")
            {
                LoginButton.Focus();
            }
            else if (UserClient.JsonSettings.LoginName != "")
            {
                PasswordBox.Focus();
            }
            else
            {
                NameTextBox.Focus();
            }


            // 加载原先保存的主题配色
            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"Palette.txt"))
            {
                using (StreamReader sr = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + @"Palette.txt", Encoding.UTF8))
                {
                    string temp = sr.ReadToEnd();
                    MaterialDesignThemes.Wpf.Palette obj = JObject.Parse(temp).ToObject <MaterialDesignThemes.Wpf.Palette>();
                    new PaletteHelper().ReplacePalette(obj);
                }
            }
        }
Exemplo n.º 20
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (string.IsNullOrEmpty(EmailEntry.Text))
            {
                EmailEntry.Focus();
            }
            else if (string.IsNullOrEmpty(PasswordEntry.Text))
            {
                PasswordEntry.Focus();
            }
            else
            {
                LoginButton.Focus();
            }

            ViewModel.MessageLabel       = string.Empty;
            ViewModel.CanExecuteCommands = true;
        }
        public LoginMenu()
        {
            InitializeComponent();
            _eventManager = EventManager.Instance;
            _user         = User.Instance;
            _userAccess   = UserAccess.Instance;

            // handle Remembre-me
            if (Settings.Default.RememberMe)
            {
                RememberMeCheckbox.IsChecked = true;
                UsernameEntry.Text           = Settings.Default.Username;
                PasswordEntry.Password       = Settings.Default.Password;
                PasswordEntryTip.Visibility  = Visibility.Hidden;
                LoginButton.Focus();
            }

            // Change Title
            MainWindow.Instance.SwitchTitle("Connexion");
        }
Exemplo n.º 22
0
        } // FindIDTextBox_KeyDown

        /// <summary>
        /// On Find button click start search
        /// </summary>
        /// <param name="sender">event source</param>
        /// <param name="e">event parametres</param>
        private void FindButton_Click(object sender, RoutedEventArgs e)
        {
            // Check step 1 
            if (currentUser == null || token == null)
            {
                ErrorText.Content = "Шаг 1: войдите ВКонтакте, нажав Войти";
                ErrorText.Foreground = new SolidColorBrush(Color.FromRgb(223, 0, 0));
                LoginButton.Focus();
                System.Media.SystemSounds.Exclamation.Play();
                return;
            } // if (currentUser == null || token == null)
            // Check step 2
            if (searchedUser == null)
            {
                ErrorText.Content = "Шаг 2: введите адрес и нажмите Проверить";
                ErrorText.Foreground = new SolidColorBrush(Color.FromRgb(223, 0, 0));
                System.Media.SystemSounds.Exclamation.Play();
                FindIDTextBox.Focus();
                return;
            } // if (findingUser == null)
            
        }// FindButton_Click
Exemplo n.º 23
0
 private void OnTextBoxKeyReleased(object sender, KeyEventArgs args)
 {
     if (args.Key == Key.Enter)
     {
         if (sender == Username)
         {
             Password.Focus(); // Show move keyboard to password input
         }
         else if (sender == Password)
         {
             LoginButton.Focus(); // Hide keyboard
         }
         else if (sender == ServerUrl)
         {
             ServerUrlButton.Focus(); // Hide keyboard
             SaveServer();
         }
         else if (sender == NewLibraryId)
         {
             NewLibraryAddButton.Focus(); // Hide keyboard
             RequestAddingLibrary();
         }
     }
 }
Exemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (((ELearn.User)Session["user"]) != null)
        {
            Response.Redirect("home.aspx");
        }
        List <ClassRoom> classes = ClassRoom.GetAllClassRooms();

        foreach (ClassRoom cls in classes)
        {
            Level  lvl   = Level.GetLevelById(cls.levelID);
            string lname = "";
            if (lvl != null)
            {
                lname = lvl.levelName;
            }
            else
            {
                lname = cls.levelID.ToString();
            }
            ListBox1.Items.Add(new ListItem(lname + " - " + cls.classRoomID.ToString(), cls.classRoomID.ToString()));
        }
        LoginButton.Focus();
    }
Exemplo n.º 25
0
 private void PasswordEntry_Completed(object sender, EventArgs e)
 {
     LoginButton.Focus();
 }
Exemplo n.º 26
0
 protected void edsenha_TextChanged(object sender, EventArgs e)
 {
     LoginButton.Focus();
 }
Exemplo n.º 27
0
 private void ToggleButton_Unchecked(object sender, RoutedEventArgs e)
 {
     LoginButton.Focus();
 }
Exemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of <see cref="MainWindow"/> class
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     mouse = new Point();
     LoginButton.Focus();
 }
 protected void Page_Init(object sender, EventArgs e)
 {
     UserNameBox.Text = Request.Cookies.Get("userName")?.Value ?? "User";
     LoginButton.Focus();
 }
Exemplo n.º 30
0
 public LoginPage()
 {
     InitializeComponent();
     EmailEntry.Completed    += (sender, args) => { PasswordEntry.Focus(); };
     PasswordEntry.Completed += (sender, args) => { LoginButton.Focus(); };
 }