I would like to make X control closing window to hide current display previous form.
In form1 I got:
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.Tag = this;
form2.Show(this);
Hide();
}
and then when I click X I would like to show previous and hide the current.
You have to keep track of your instanced forms.
Then:
You can override OnFormClosing to do this.
You should not override
Form.OnFormClosing()
for just this. TheForm.FormClosing
event provides this functionality for you: