Пример #1
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            NameBox.Text      = "";
            SurnameBox.Text   = "";
            FullNameShow.Text = "";
            FullNameShow.Hide();
            PasswordBox.Text       = "";
            RepeatPasswordBox.Text = "";
            BirthdayPicker.Value.ToLocalTime();
            SSNBox.Text   = "";
            EmailBox.Text = "";
            CodeBox.Text  = "";

            NamewarningLabel.Hide();
            SurnamewarningLabel.Hide();
            BirthdaywarningLabel.Hide();
            PassWarningLabel.Hide();
            PassRepeatWarningLabel.Hide();
            SSNwarningLabel.Hide();
            EmailWarningLabel.Hide();

            NameBox.Focus();
        }
Пример #2
0
        private void PasswordBox_Leave(object sender, EventArgs e)
        {
            bool validPass = ValidatePassword(PasswordBox.Text);

            if (PasswordBox.Text.Length < 5)
            {
                PassWarningLabel.Text = "Password must be at least 5 chars long!";
                PassWarningLabel.Show();
            }

            else
            {
                if (validPass)
                {
                    PassWarningLabel.Hide();
                }

                else
                {
                    PassWarningLabel.Text = "Password didn't match criteria!";
                    PassWarningLabel.Show();
                }
            }
        }