我已经使用函数Find Text创建了搜索表单,如何保存上次搜索,以便在表单重新打开时创建Find Again按钮?如何在WinForm上保存搜索
我的搜索代码:
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.");
}
}