private void FindButton_Click(object sender, EventArgs e) { using (CustomerFindWin FindForm = new CustomerFindWin()) { DialogResult result = FindForm.ShowDialog(); if (result == DialogResult.OK) { try { var custList = Customers.Retrieve(); DetailDataGridView.DataSource = custList.FindCustomers(FindForm.NameToFind); } catch (ArgumentOutOfRangeException) { MessageBox.Show("No text was entered for the find."); } } } }
private void FindButton_Click(object sender, EventArgs e) { using (CustomerFindWin FindForm = new CustomerFindWin()) { DialogResult result = FindForm.ShowDialog(); if (result == DialogResult.OK ) { try { var custList = Customers.Retrieve(); DetailDataGridView.DataSource = custList.FindCustomers(FindForm.NameToFind); } catch (ArgumentOutOfRangeException) { MessageBox.Show("No text was entered for the find."); } } } }