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

I'm building a program to sends email's throw the SMTP.
I have a question.
How can i make a form that has multiple buttons that change the form itself.

Let me rephrase.

Normal programs have a main "form" and several buttons. If you click a button they instead of opening another windows they change the current form.

Example.

You have this.
[IMG]

And if you click in "Registo" it changes the original window.
http://img406.imageshack.us/img406/4834/13441708.jpg[IMG]

I want to know how can i do this in Visual C++ 2010 forms.

Ty,
Posted
Updated 2-Dec-11 1:40am
v2
Comments
RKnGl 2-Dec-11 11:55am    
TAB control ?

Each item on the form can be displayed or not by setting its Visible property to true or false. So you can have a number of different controls on the form overlaying each other but show only one as selected when the user takes some action.
 
Share this answer
 
Comments
Albert Holguin 2-Dec-11 9:10am    
That's a simple way of doing it... unless there's a really large number of buttons... then it's probably easier to handle it programatically. +5
Richard MacCutchan 2-Dec-11 12:12pm    
I meant programatically.
Albert Holguin 2-Dec-11 13:14pm    
Yeah, I guess that's programmatic as well... my bad... I meant you can create button objects and place/remove them all over the place as objects, without going through the resource editor.
Richard MacCutchan 2-Dec-11 13:20pm    
The usual story; a large number of questions here are quite open to interpretation. And because some 50% of those where I put an answer get no acknowledgement from the OP I often don't know if my interpretation was correct :(
Mohibur Rashid 2-Dec-11 23:09pm    
In this case you wont get any acknowledgement too. cause the way op asked the question, its clear that he has not reach that stage where he can understand about what you have said
One way of doing it is to create one user control per "page". A panel on the right side of the form will then contains the current page.

You can dynamically remove old page and add new one when the user do another selection by clicking one of the button on the left side.

Or if you prefer hide old page and show new one.

Typically, your panel would also need functions (or events) to be able to validate a page when the user click on the button of another page so that the change will be prevented if the content of the actually displayed page is not valid.
 
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