Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello!

I'm trying to build an application concisting of several different forms. When I click on a button I want to navigate to another form. I manage to do this by writing:

Form1 form1 = new Form1();
form1.Show();

However, it opens in a new window and I want it to be opened in the same window. Is there a way to do this? I also want the user to be able to upload pictures which then is gonna go into a database, by a button_click, is this possible. I haven't worked eith apps that much, just web-programming.

All the best

Simon
Posted

1 solution

Are you using WinForms?

If so, you can't open a form inside another form. You can, however, create UserControls instead of Forms. Then in your one Form, either create instances of them dynamically, or put them all on the Form and set their Visible properties.

Nick
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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