Use the form I am adding to my project

I added a form from another solution. (With the right to my decision and clicking add an existing element, then select the resent form with the name "newForm.cs"). Then this form with its own objects was added to my project. But I can not use this form in my code. For example, I want to show this form. But this is not in my solution as the class I use: "newForm frm = new newForm". How can I add this form, which I can use as a class. I hope I asked the right question. Many thanks.

+3
source share
2 answers

If you want to set this as a startup form, then Edit that from program.cs

, , , , .

, instace .

Formname frm1 = new Formname();
frm1.show();
+6

- , , :

Form2 frm = new Form2();
//set other properties
frm.Show();

, , Program.cs Application.Run

Application.Run(new Form2());

, , . ( .. ).

using .

0
source

Source: https://habr.com/ru/post/1790165/


All Articles