9 Replies - 19634 Views - Last Post: 03 December 2013 - 11:32 PM Rate Topic: -----

#1 Mattlav  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 21-December 08

How do i merge two C# projects and run a form from one of them in the

Posted 30 June 2009 - 01:47 AM

Hey,

Im trying to run two C# projects (merge together) and then from the click of a button open up a form from the other project if that made sense.. so for example i have project 1 and project 2 i want to merge them together and then say in project one create a button that opens up a windows form that has been created in project 2?

Sorry im quite a newbie with all this :)

Thanks,

Mattlav :)

Is This A Good Question/Topic? 0
  • +

#3 Bocard  Icon User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 223
  • Joined: 24-September 08

Re: How do i merge two C# projects and run a form from one of them in the

Posted 30 June 2009 - 07:00 AM

you open the fist project in c#, then you right click the solution and select Add -> Existing Project, so you add the second project in your solution.

Then you add a reference by right clicking the first project->Add reference, go in the Projects tab and select the second project.

After these steps you should be able to access the forms from your second project like this:

private void button1_Click(object sender, EventArgs e)
		{
			WindowsFormsApplication2.Form1 aa = new WindowsFormsApplication2.Form1();
			aa.Show();
		}


this way you create a new instance of the Form you need from the second project and the Show it.

I hope you understand.

PS: If this helped you, please click the button below: "This Post Was Helpful!"
Was This Post Helpful? 4
  • +
  • -

#4 Mattlav  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 21-December 08

Re: How do i merge two C# projects and run a form from one of them in the

Posted 30 June 2009 - 07:11 AM

Yeh thanks mate it did help! :)
Was This Post Helpful? 0
  • +
  • -

#5 Guest_Eng mohammed refaat*


Reputation:

Re: How do i merge two C# projects and run a form from one of them in the

Posted 05 March 2010 - 08:03 AM

MORE THANKS
Was This Post Helpful? 0

#6 Guest_Sachin Baranwal*


Reputation:

Re: How do i merge two C# projects and run a form from one of them in the

Posted 18 March 2010 - 03:50 AM

Thanks a lot
Was This Post Helpful? 0

#7 Udith  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-March 12

Re: How do i merge two C# projects and run a form from one of them in the

Posted 11 March 2012 - 09:38 AM

Very much helpful. Thanks a lot. :)
Was This Post Helpful? 0
  • +
  • -

#8 theshamaN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-March 13

Re: How do i merge two C# projects and run a form from one of them in the

Posted 08 March 2013 - 04:18 AM

View PostBocard, on 30 June 2009 - 07:00 AM, said:

you open the fist project in c#, then you right click the solution and select Add -> Existing Project, so you add the second project in your solution.

Then you add a reference by right clicking the first project->Add reference, go in the Projects tab and select the second project.

After these steps you should be able to access the forms from your second project like this:

private void button1_Click(object sender, EventArgs e)
		{
			WindowsFormsApplication2.Form1 aa = new WindowsFormsApplication2.Form1();
			aa.Show();
		}


this way you create a new instance of the Form you need from the second project and the Show it.

I hope you understand.

PS: If this helped you, please click the button below: "This Post Was Helpful!"


THANKS A LOT !
Was This Post Helpful? 0
  • +
  • -

#9 RH-Design  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 13-December 12

Re: How do i merge two C# projects and run a form from one of them in the

Posted 03 December 2013 - 11:14 AM

View PostBocard, on 30 June 2009 - 03:00 PM, said:

you open the fist project in c#, then you right click the solution and select Add -> Existing Project, so you add the second project in your solution.

Then you add a reference by right clicking the first project->Add reference, go in the Projects tab and select the second project.

After these steps you should be able to access the forms from your second project like this:

private void button1_Click(object sender, EventArgs e)
		{
			WindowsFormsApplication2.Form1 aa = new WindowsFormsApplication2.Form1();
			aa.Show();
		}


this way you create a new instance of the Form you need from the second project and the Show it.

I hope you understand.

PS: If this helped you, please click the button below: "This Post Was Helpful!"


I'm using VS 2010:
I can just see "Add existing item...". What file do I have to add into my first program?
I tried different things, but nothing makes me see a project standing in the Projects tab when I choose to Add a reference.

Can somebody please point me into the right direction?
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9206
  • View blog
  • Posts: 34,588
  • Joined: 12-June 08

Re: How do i merge two C# projects and run a form from one of them in the

Posted 03 December 2013 - 11:16 AM

Two things.. first te last post is what - 2009? A bit old to be necroing int.

Second - right click on your SOLUTION not the project.
Was This Post Helpful? 0
  • +
  • -

#11 RH-Design  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 13-December 12

Re: How do i merge two C# projects and run a form from one of them in the

Posted 03 December 2013 - 11:32 PM

View Postmodi123_1, on 03 December 2013 - 07:16 PM, said:

Two things.. first te last post is what - 2009? A bit old to be necroing int.

Second - right click on your SOLUTION not the project.

Next time I'll start a new topic.
Anyway ... thanks a lot. You were of much help. The problem was that I didn't see the solution file in the right column.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1