Пример #1
0
        private bool RequiredFieldControl()
        {
            if (string.IsNullOrEmpty(TxtBxUserName.Text.Trim()))
            {
                MessageBox.Show("Please enter your username!",
                                Settings.MessageBoxTitle,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);

                TxtBxUserName.BackColor = Color.Red;
                TxtBxUserName.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(TxtBxPass.Text.Trim()))
            {
                MessageBox.Show("Please enter your password!",
                                Settings.MessageBoxTitle,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);

                TxtBxPass.BackColor = Color.Red;
                TxtBxPass.Focus();
                return(false);
            }
            else
            {
                return(true);
            }
        }
Пример #2
0
        private void userLogin_FailedLogin(FailedLoginEventArgs args)
        {
            v_bl_LoginState = false;
            MessageBox.Show(args.FailedResult, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);

            TxtBxUserName.SelectAll();
            TxtBxUserName.Focus();
        }