-1

In my program there are 2 forms. There is a loop function in Form1. I can show Form2 from a button. By using:

Form1 form2 = new Form2();
frm2.show(); 

method. When I pressed a button on From2 to show Form1, Form1 starts its loop again(resets). How can I hide Form1 temporary and show it again from the point it hides.

Emad
  • 3,809
  • 3
  • 32
  • 44
  • Possible duplicate of [Hide and show Form in WinForms application](http://stackoverflow.com/questions/12213513/hide-and-show-form-in-winforms-application) – M. Adeel Khalid Feb 08 '17 at 06:45
  • Possible duplicate of [Winform Forms Closing and opening a new form](http://stackoverflow.com/questions/1677528/winform-forms-closing-and-opening-a-new-form) – Steeve Feb 08 '17 at 08:05

1 Answers1

0

You can use Form1.Hide() which keeps the instance alive while don't displays it. For better answers you need to provide more code and also better explanation of your case scenario.

LarsTech
  • 80,625
  • 14
  • 153
  • 225
Emad
  • 3,809
  • 3
  • 32
  • 44