I want to change my form 1 into form 2. I don\'t want it to open a new window but keep it in the same window and then be able to go back and forth when I press the Next key or b
You can use panels, group boxes, TabControls, etc. to group common controls together. When you want to switch between different "screens", you can hide or show the group control by setting the visible
property and calling BringToFront()
, and it will hide/show all the controls on that group control.
You might want to consider a different approach.
You can't change one type of form into a different type of form. The closest option would be to close or hide the first and show the second at the same location on the screen.
However, you could approach this differently. Instead of putting your buttons and logic into a form, you could place everything into two UserControl
instances, and just change which user control is visible within a single form.