Click here to Skip to main content
15,888,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
so im i have a a form and i want when you press a button everything that is currently on the screen disappears and a new page shows up (not a new form). i tried to achieve this with user controls but within the code of a user control i was only ably to hide that user control but not to let a new one show up.

what i want to achieve is that there is lets say a screen with different text boxes and 1 button and when you press that button they all disappear including the button and then new buttons and text boxes show up. can someone help me achieving this ?

What I have tried:

searching the internet but i could not find anything that could help me.

also i tried to work with panels but it was hard to design the form with multiple panels.
Posted
Updated 19-Aug-18 1:54am
v2

Don;t try to do it from within the user control: instead, have the control generate a "next page request" event which the parent form handles by closing the control and opening a new one. That way, teh control doesn't have to know if there are more pages, but teh parent - which is in charge after all - does.

It may sound complicated, but it isn't, not at all. See here: Transferring information between two forms, Part 2: Child to Parent[^] - it's talks about forms, but it works exactly the same way for user controls!
 
Share this answer
 
v2
What you need is a TabControl.[^]
If you want, you can hide the tabs this way: How to Hide TabControl Headers[^]
 
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