-
May 8th, 2009, 08:22 AM
#1
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:
Button1: TabPage1
Button2: TabPage2
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.
-
May 8th, 2009, 12:55 PM
#2
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:
Code:
m_TabCtrl.SetCurPos( 0 ); // zero based index sets the first tab
..the second button handler:
Code:
m_TabCtrl.SetCurPos( 1 ); // zero based index sets the first tab
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|