Pressing a button and send you to the correct tabpage.
Greetings! I have created seperate tabs, each tab solves a mathematic problem, on windows application form. My problem is that I want to create a menu, where each user of my program can choose with which tab want to work with. So I need a command which ll send my program to the correct tab.
For example I want to create 2 buttons 1 will send me to the first tab and the other button to the second tab:
I have 1 idea how to do it.
By adding a new form before my current form.
But still I dont know the command that can do what I need, send my program to the correct tab depending on what I have choose on my menu.
Sorry about my english. Thanks in advance.
Re: Pressing a button and send you to the correct tabpage.
Create a member variable for the tab control.
In each of the button handlers, call SetCurPos for the tab control.
For example, in the first button handler:
..the second button handler:
m_TabCtrl.SetCurPos( 0 ); // zero based index sets the first tab
m_TabCtrl.SetCurPos( 1 ); // zero based index sets the first tab