private void ActOK_Click(System.Object sender, System.EventArgs e) { // ----- The region name is required. if (RegionName.Text.Trim().Length == 0) { MessageBox.Show("Please provide a region name."); RegionName.Focus(); return; } // ----- Success. this.DialogResult = DialogResult.OK; }