I am doing Windows Forms Application. When the user clicks a button I am hiding the current page and navigating to another page.
// in the button click event
Vehicle_Registration ob = new Vehicle_Registration(this);
ob.Show();
this.hide();
But the problem here is, in the Vehicle_registration Page, if the user clicks the Close Button in the Control Box then this page is closing, but the previous page(Main Page) is not in visible. I don’t want to disable the Close Button. Where i Can write the code for visiability for the Main Page?
if I get it right the way you are doing things, you pass
thisto the other form constructor so you have a reference to your firstFormin there.in the Form_Closing event of the second form just do
Parent.Show();or anything similar using the form reference you got in the construction.