private void textBox2_Click(object sender, EventArgs e) { PassWordTextBox.Clear(); PassWordTextBox.ForeColor = Color.Black; if (UserNameTextBox.Text == "") { UserNameTextBox.ForeColor = Color.Gray; UserNameTextBox.Text = "Enter User Name Here"; } }
private void PassWordTextBox_Enter(object sender, EventArgs e) { PassWordTextBox.Clear(); PassWordTextBox.ForeColor = Color.Black; PassWordTextBox.UseSystemPasswordChar = true; if (UserNameTextBox.Text == "") { UserNameTextBox.ForeColor = Color.Gray; UserNameTextBox.Text = "Enter User Name Here"; } }
private void PassWordTextBox_Enter(object sender, EventArgs e)// ברגע שנכנסים לתיבה אז נמחק כל התוכן בו והכתב הופך לשחור { PassWordTextBox.Clear(); PassWordTextBox.ForeColor = Color.Black; PassWordTextBox.UseSystemPasswordChar = true; if (UserNameTextBox.Text == "") { UserNameTextBox.ForeColor = Color.Gray; UserNameTextBox.Text = "Enter User Name Here"; } }
private void textBox2_Click(object sender, EventArgs e)//אותו דבר כמו התיבה של השם משתמש { PassWordTextBox.Clear(); PassWordTextBox.ForeColor = Color.Black; PassWordTextBox.UseSystemPasswordChar = true; if (UserNameTextBox.Text == "") { UserNameTextBox.ForeColor = Color.Gray; UserNameTextBox.Text = "Enter User Name Here"; } }
private void ClearFormData() { comboBox1.SelectedIndex = -1; ServerNameComboBox.SelectedIndex = -1; DBNameComboBox.SelectedIndex = -1; NameTextBox.Clear(); PNTextBox.Clear(); LoginNamrTextBox.Clear(); UserNametextBox.Clear(); PassWordTextBox.Clear(); //radioButton1.Checked = false; //radioButton2.Checked = false; }
private bool Validar() { bool paso = true; if (string.IsNullOrWhiteSpace(UserTextBox.Text)) { errorProvider.SetError(UserTextBox, "Este Campo Esta vacio"); UserTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(PassWordTextBox.Text)) { errorProvider.SetError(PassWordTextBox, "Este Campo Esta vacio"); PassWordTextBox.Focus(); paso = false; } if (PassWordTextBox.TextLength < 8) { errorProvider.SetError(PassWordTextBox, "Las contraseñas son mayor o igual a 8 caracteres"); PassWordTextBox.Focus(); paso = false; } return(paso); }