Reputation: 147
I have two projects, Project A and Project B. Both are under same Solution. I want use a page of Project A in Project B. How to call that page from Project B. Thanks in advance.
Upvotes: 0
Views: 387
Reputation: 1214
Its possible to acceess another solution forms you have 2 projects in the same solution.
To open a form from another project, you have to add a reference to that project.
In the first project, right-click on the References item in the Solution Explorer window.
Select the Add Reference option. Select the Projects tab and select the second project.
Click OK. Then, to access a form from the second project just use this:
Yourproject2.FormsName objName=new YourProject2.FormName();
objName.Show();
Upvotes: 1
Reputation: 191
First add a reference to your other project, then just call:
NavigationService.Navigate(new ProjectB.page());
Upvotes: 1
Reputation: 5070
You need to add a reference to Project A in your Project B. You can do this by RMC on a ProjectB and choosing Add reference... . Then in a new window go to Projects tab and choose Project A. After that, you can call the page in Project B: Pseudo-code:
ProjectA.PageNamespace page = new ProjectA.PageNamespace()
Upvotes: 0