I am trying to switch between to form in different project currently I am going this:

this.Hide();
 form2 f= new form2();
 f.Show();

the new instance of form2 throws a null exception error. But I think because form2 is not active.

How do I work around this or is there a between way to achieve this.

Thinks...

ur code is right if both from in same project.
but if other project add other project in ur reference and the use

using WindowsFormsApplication1;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            this.Hide();

            WindowsFormsApplication1.Form1 f = new WindowsFormsApplication1.Form1();

            f.Show();
        }
    }
}

Edited 3 Years Ago by Nick Evan: Fixed formatting

ur code is right if both from in same project.
but if other project add other project in ur reference and the use

using WindowsFormsApplication1;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            this.Hide();

            WindowsFormsApplication1.Form1 f = new WindowsFormsApplication1.Form1();

            f.Show();
        }
    }
}

Edited 3 Years Ago by Nick Evan: Fixed formatting

This question has already been answered. Start a new discussion instead.