private void button1_Click(object sender, EventArgs e) { if (comboBox1.Text != null && textBox1.Text != null) { if (textBox1.Text.Length > 0 && textBox1.Text.Length <= 30 && comboBox1.Text.Length <= 8 && comboBox1.Text.Length > 0) { databaseService.AddNewAccount(storedObject.Id, textBox1.Text, comboBox1.Text); WindowManager.navigateToForm(this, this.GetType(), typeof(Homescreen)); } } else { MessageBox.Show("Invalid Account Info Provided: Account Name must have legnth > 0 and < 30. Combobox must have length < 8"); } }