private void goButton_Click(object sender, EventArgs e) { this.billType = GetBillType(); if (!float.TryParse(this.billRateTextBox.Text, out this.billRate)) { MessageBox.Show("Please enter the correct bill rate"); return; } this.DialogResult = DialogResult.OK; }