I need to be able to create another brand new instance of a program on a button click while keeping the existing instance.
this.ShowDialog(new Form1());
The above statement causes the current form to be the owner of the new form and I need the second instance to be independent of the existing instance.
Can anyone help me with this?
To expound on Desolator's answer here is a simplistic example you can try a Form and a Button:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = Application.ExecutablePath;
p.Start();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With