Click here to Skip to main content
15,849,829 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more: (untagged)
Hi

can any body please tell how to navigate between forms in windows application.

like back and forward in web browser.

Thanks in advance.
ngrj.
Posted

create a form object, close the previous form and open the next form
 
Share this answer
 
Form1 child = new Form1(); //create new isntance of form

child.FormClosed += new FormClosedEventHandler(child_FormClosed); //add handler to catch when child form is closed

child.Show(); //show child

this.Hide(); //hide parent




C#
void child_FormClosed(object sender, FormClosedEventArgs e)
            {
               this.Close();
            }
 
Share this answer
 
Some discussions here[^] as well.
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900