不同的2个表单,如果您关闭一个表单,如何在另一个表单中运行按钮单击事件? [英] different 2 form and ıf you close a form, how can run button clıck event in another form?
本文介绍了不同的2个表单,如果您关闭一个表单,如何在另一个表单中运行按钮单击事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想做我的朋友,但我不知道该怎么办.
有2种形式.如果我关闭一个窗体,我想在另一个窗体中运行一个按钮clıck事件.我该怎么办?
I want to do my frıends but I dont know how can I do.
There is 2 form. If I close a form, I want to run a button clıck event in another form. How can I do?
推荐答案
将其他表单的点击事件设为公开.
另一种形式的关闭..
make the other form''s click event Public.
On Close of the other form..
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Form2.Button1_Click(null, null);
}
因此,您调用button1_click事件并传递2个null''cos并不需要鼠标真正的eventargs:/
祝你好运
So your calling the button1_click event, passing 2 nulls'' cos dont need eventargs from mouse really :/
good luck
这篇关于不同的2个表单,如果您关闭一个表单,如何在另一个表单中运行按钮单击事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文