I have created a Search form with a function Find Text, How do I save the last search so I can create a Find Again Button when the form has been re-opened?
My code for the search is:
private void btnSearch_Click(object sender, EventArgs e)
{
if (cboField.SelectedIndex == -1)
{
return;
}
if (txtValue.TextLength == 0)
{
return;
}
string filter;
filter = "[" + cboField.Text + "]";
filter += lblOperation.Text + "'" + txtValue.Text + "'";
try
{
peopleBindingSource.Filter = filter;
}
catch (System.Data.EvaluateException)
{
MessageBox.Show("Please enter valid values in your text fields.");
}
}