private void button1_Click(object sender, EventArgs e) { // validate text exists in all boxes if ((StationName.Text == "") || (RouteStep.Text == "") || (ProductName.Text == "") || (OrderNumber.Text == "") || (Operator.Text == "")) { // show dialog for bad value MessageBox.Show("You must enter all data to continue.", "Routing Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); // set focus on textbox StationName.Select(); } else { // save the information for the Vtech log file. // hide the box this.Hide(); } }
public VtechInput(MainForm parent) { InitializeComponent(); frmMain = parent; // set focus on textbox StationName.Select(); }