Question Transition between forms

ExorTek

New member
Joined
Dec 30, 2020
Messages
3
Programming Experience
1-3
There are 2 forms in my project. Form2 is opened from the Form1 with the P key. When I close the Form2 and press the P key again. How can I restart all the contents of my Form2.
 
Pass in a object into that has the contents to be displayed by Form2. When values change in the UI of Form2, update the object. Later after Form2 closes and another instance of Form2 is created, pass in the same object.

Basically this is the application of the concept of keeping your Model (e.g. your data) separate from your View (e.g. your UI). If you've heard of the MVC, MVP, or MVVM patterns, all of these rely on the that concept of the keeping view and data separate. The only job of the view is to reflect the current state of the model.
 
Back
Top Bottom