in form1 , there are two functions , one for a button 's click event
private void bQuery_Click(object sender, EventArgs e)
{
string sPrefix = tbPrefix.Text.Trim();
QueryAll(sPrefix);
}
another one is a task
async Task QueryAll(string sPrefix)
{
}
now I need invoke form1 's task in form2 certain function , such as
string prefix = "abc";
frm = new form1();
frm.ShowDialog();
frm.Dispose();
frm.QueryAll(sPrefix);
I know this statement
frm.QueryAll(sPrefix);
can not compile , just to show what I want to do , anyone knows how to call this task "QueryAll" ? thanks for your help