public partial class UserLoginForm : Form
{
private void LoginForm_Load(object sender, EventArgs e)
{
Common.UserLoginFormObject = this; //Store UserLoginForm Object in Static class Common.
}
private void DoSomething()
{
//some code
}
}
public partial class MainForm : Form
{
private void cmdLogOut_Click(object sender, EventArgs e)
{
Common.UserLoginFormObject.DoSomething();//Now here i have to call Dosomething function.
}
}
如何从另一个表单调用表单 1 函数。