0

Lets say I have 3 windows forms (called form1, form2 and form3) with 2 buttons in them. Forward and Backward buttons. In form1 forward button I have this code:

Form2 f2 = new Form2();
            f2.Show();
            this.Hide();

In form2 forward button I have this code:

Form3 f3 = new Form3();
            f3.Show();
            this.Hide();

In form3 I have only one button backward

Form2 f2 = new Form2();
            f2.Show();
            this.Hide();

It is working but I have the feeling that this is not the proper way to navigate true several forms ..

Fi Jeleva
  • 65
  • 9
  • IF you want to navigate through "pages" better use WPF, it's designed for that type of UI. Usually classic Winforms have a main form and some utility forms, you don't "navigate" through them. But of course this is opinion based. And that's why I vote to close the question. – Gusman Jul 16 '17 at 16:17

1 Answers1

0

That method is ok just remember not to close form1 since that is the main form. Additionally you can close other forms other than form1 using this.Close();

MickyD
  • 14,343
  • 6
  • 43
  • 67