请问用C#写的程序怎样触发另一个程序的click等事件?请求各位大虾给我一个有代码的例子!谢谢!!!

我问的是两个毫不相干的程序之间。
2025-03-07 10:36:13
推荐回答(3个)
回答1:

假设那个事件A_Click(sender s,evenearge e)(事件函数),触发很简单,直接调用就可以了
当事调用函数就可以了,比如:a_click(null,null);//参数你自己决定

回答2:

private void tsbExport_Click(object sender, EventArgs e)
{
tab_inv.SelectedTab = tabPage2;
int icount = 0, j = 0;
string FilePath = "";
icount = countSelect(dgvtotal);
if (icount <= 0)
{
MessageBox.Show("至少要选择一张单据才能导出", "提示讯息", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
sfdInvoice.Filter = "文本文件(*txt)|*txt";
sfdInvoice.FileName = DateTime.Now.ToShortDateString() + "OutSaleBill.txt";
if (sfdInvoice.ShowDialog() == DialogResult.OK)
{
FilePath = sfdInvoice.FileName;
}
else
{
return;
}
tsbImport_Click(sender,e)
}

回答3:

用这个程序去完成另一个程序click的要求撒...