I have 2 winform applications, say form1
and form2
.
They are programmed through separate visual studio programs
form1
is programmed in WindowsFormsApplication1.sln
form2
is programmed in WindowsFormsApplication2.sln
I want to open form2
(=WindowsFormApplication2.exe) by clicking a button in form1
I created a method in WindowsFormApplication1.sln
private void button3_Click(object sender, EventArgs e)
{
var p = new Process();
p.StartInfo.FileName ="WindowsFormsApplication2.exe";
p.StartInfo.Arguments = "10";
p.Start();
}
This method opens WindowsFormApplication2.exe
Then I need WindowsFormApplication2 MessageBox show the value got from WindowsFormApplication1.exe. Is this clear?
This should be clear... I cannot explain more simply than this
What other people have answered through comment or answerbox, is not what I want
If I want to pass a value from form1
to form2
that are in same .sln (That is, WindowsFormApplication1.sln has form1 and form2), this is so easy
I could just use
Form2 form2 = new Form2(textBox1.Text);
form2.Show();
Constructor Form2
:
public Form2(string smth)
{
InitializeComponent();
label1.Text = smth;
}
But this is not what I want
I think everything is clear. Please tell me how to solve the problem