コード例 #1
0
 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;
 }
コード例 #2
0
 private bool IsFormValidate()
 {
     if (UserNametextBox.Text.Trim() == "")
     {
         MessageBox.Show("User Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
         UserNametextBox.Clear();
         UserNametextBox.Focus();
         return(false);
     }
     if (PasswordtextBox.Text.Trim() == "")
     {
         MessageBox.Show("Password is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
         PasswordtextBox.Clear();
         PasswordtextBox.Focus();
         return(false);
     }
     return(true);
 }