Upon showing back a form after being hidden, how to refresh its contents?
Posted on 2012-03-26
I'm using Visual Studio 2010 Professional and I have a Windows Application that contains two forms .. let's call them [Form1] and [Form2]
There is a button on each of those forms that toggles the show & hide functionality between these two forms, in more details:
[Form1] contains some dymanically-created controls at run time as well as contains a button that if clciked then to hide [Form1] and show [Form2]
[Form2] contains a button that if clciked then to hide [Form2] and show [Form1]
What I need is:
When clicking on the button that is in [Form2] then:
1st: Hide [Form2]
2nd: Show [Form1]
3rd: Dynamically recreate those controls in [Form1]
How do I achieve this (3rd) step?? I tried using the on "Shown" even of [Form1] but it didn't work!!!