Two steps are needed:
First, Form Alpha needs a public Fucntion called "hidePane()" whose sole purpose is to hide the Pane.
Second, Form Beta needs a reference to Form Alpha. I asume that Alpha creates generates Beta and shows it. In this case give Beta a constructor that takes a FormAlpha as parameter:
Instead of using the normal empty constructor to create FormBeta:
use the newly created one and give it a Reference to Alpha with "this":
now all your ButtonClick even has to do is call the hidePanle():
P.S. if you want to be able to unhide he Panel as well, we may have to change step 1 a little.
No comments:
Post a Comment