Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my winForm project Tabcontrol I have a Tabcontrol with 6 TabPages and two Buttons.
The First Button 'Next' and another Button 'Back'.
When I click 'Next' I want to go to next TabPage, when I click Back I want to go to the previous TabPage.
How can I do that???

Not : The Same Report Wizard in MS Access 2007.
Posted
Updated 15-Jan-11 0:55am
v2

Use the TabControl.SelectedIndex[^] property: If you increase or decrease it, you will move to next or previous pages. remember to check you are still within the page count though!
 
Share this answer
 
Comments
Espen Harlinn 15-Jan-11 7:28am    
5+ Good answer :)
You may want to revisit your UI design. User can do this just by clicking the tab page header.
 
Share this answer
 
Comments
Espen Harlinn 15-Jan-11 7:30am    
4+ He could be working on a wizard type of UI
dan!sh 15-Jan-11 8:22am    
Wizard with next button to move through tab pages! That's a fake wizard. :)
Espen Harlinn 15-Jan-11 8:45am    
I agree, but we've all seen it - even in apps from some well known companies :)
Estys 15-Jan-11 7:31am    
Yeah, but this is much more fun :) +5
OT : Do you get a notification when somebody adds a comment to your answer? I don't.
Could you reply by adding a reply to this comment. I just saw that button, brand new I think.
OriginalGriff 15-Jan-11 7:40am    
Estys: I reported it in Sugs&Bugs. I assume it is to do with the recalc of the recalc that is in progress today (and probably tomorrow as well).

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