Ejemplo n.º 1
0
        private void NameBox_Leave(object sender, System.EventArgs e)
        {
            if (NameBox.Text.Length == 0)
            {
                NamewarningLabel.Visible = true;
            }

            else if (!Regex.Match(NameBox.Text, _nameSurnamePattern).Success)
            {
                NamewarningLabel.Visible = true;
            }

            else
            {
                NamewarningLabel.Visible = false;
            }

            if (NameBox.Text != "" && SurnameBox.Text != "")
            {
                FullNameShow.Text = NameBox.Text + " " + SurnameBox.Text;
                FullNameShow.Show();
            }
        }
Ejemplo n.º 2
0
        private void SurnameBox_Leave(object sender, System.EventArgs e)
        {
            if (SurnameBox.Text.Length == 0)
            {
                SurnamewarningLabel.Show();
            }

            else if (!Regex.Match(SurnameBox.Text, _nameSurnamePattern).Success)
            {
                SurnamewarningLabel.Show();
            }

            else
            {
                SurnamewarningLabel.Hide();
            }

            if (NameBox.Text != "" && SurnameBox.Text != "")
            {
                FullNameShow.Text = NameBox.Text + " " + SurnameBox.Text;
                FullNameShow.Show();
                PasswordBox.Focus();
            }
        }