コード例 #1
0
 private void PasswordTextBox1_Leave(object sender, EventArgs e)
 {
     if (PasswordTextBox1.Text.Trim() == "")
     {
         PasswordCueText1.Show();
     }
     else
     {
         if (IsNumAndEnCh(PasswordTextBox1.Text) == false)
         {
             PWD1AlertLabel.Show();
             if (PasswordTextBox1.Text != PasswordTextBox2.Text && PasswordTextBox2.Text != "" && PWD2AlertLabel.Visible == false)
             {
                 PWD2AlertLabel.Show();
             }
         }
         else
         {
             if (PasswordTextBox1.Text == PasswordTextBox2.Text && PWD2AlertLabel.Visible == true)
             {
                 PWD2AlertLabel.Hide();
             }
             else if (PasswordTextBox1.Text != PasswordTextBox2.Text && PasswordTextBox2.Text != "" && PWD2AlertLabel.Visible == false)
             {
                 PWD2AlertLabel.Show();
             }
             PWD1AlertLabel.Hide();
             PasswordCueText1.Hide();
         }
     }
 }
コード例 #2
0
 private void PasswordTextBox2_Leave(object sender, EventArgs e)
 {
     if (PasswordTextBox2.Text.Trim() == "")
     {
         PasswordCueText2.Show();
     }
     else
     {
         if (PasswordTextBox1.Text != PasswordTextBox2.Text)
         {
             PWD2AlertLabel.Show();
         }
         else
         {
             PasswordCueText2.Hide();
             PWD2AlertLabel.Hide();
         }
     }
 }