gurehbgui
gurehbgui

Reputation: 14684

How to start a c# program from another c# program in the same map?

i have two simple c# form programs, and I want to make a button in the first program start the other form when i click it, but i dont know how to access the other programm.cs main method, could you help me?

Edit: I want to start in Programm1 the main method from programm2, the assembiliti from programm2 i added to programm1

Upvotes: 1

Views: 461

Answers (3)

Guffa
Guffa

Reputation: 700362

You can't access a form or a method of the other program. One reason is that it's a separate program, another reason is that it's not running.

What you can do is to start the other program:

Process.Start("TheOtherProgram.exe");

Upvotes: 0

A_Nabelsi
A_Nabelsi

Reputation: 2574

You have to use the Process class of the System.Diagnostics namespace to start the second program, refer to this article on the MSDN,

http://msdn.microsoft.com/en-us/library/system.diagnostics.process(VS.71).aspx

Upvotes: 1

Steve
Steve

Reputation: 8511

You can use Process.Start to run a new process.

See http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start(VS.71).aspx for the docs.

Upvotes: 1

Related Questions