开发者

call form from project added as refrence to other one

i have 2 projects when t开发者_运维技巧he user Click on a button in the first project he suppose to see the form which in the Second Project ?? i am using C#


A form is just a class like any other

Library.FormClass F = new Library.FormClass()
F.Show();


Your Second Project must be compiled with the output type of Class Library. Then get a reference of the dll of your second project to your first project.

You can access a form (or controls, etc..) from your second project by creating a new object of that form.

private void button1_Click(object sender, EventArgs e)
{ 
    SecondProject.Form1 f1 = new SecondProject.Form1()
    f1.Show();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜