As ThePhantomUpvoter pointed out, you are showing a new form every time you click one of the buttons. Instead of this, you can hide each form when its button is pressed and show the other form. Here's how:
First, you need to have a reference to each form accessible in the other form. For this, I modified the Program.cs file as follows:
public static Form1 f1;
public static Form2 f2;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
f1 = new Form1();
Application.Run(f1);
}
Then, you need to modify the buttons' events to hide the current form and show the other form:
private void button1_Click(object sender, EventArgs e)
{
if (Program.f2 == null)
{
Program.f2 = new Form2();
}
this.Hide();
Program.f2.Show();
}
private void button1_Click(object sender, EventArgs e)
{
if (Program.f1 == null)
{
Program.f1 = new Form1();
}
this.Hide();
Program.f1.Show();
}