?
Solved

Adding a CTabCtrl to an existing dialog based application

Posted on 2006-10-30
4
Medium Priority
?
619 Views
Last Modified: 2013-11-20
I have an MFC dialog application.  I want to add a tab control (CTabCtrl) to my main dialog.  The existing controls of the dialog will be on the first tab and I will have a whole new set of controls on the second tab.  I have not used tab controls before, so was hoping to get some direction on the best way to approach this problem.

0
Comment
Question by:jribble
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
mac-will01 earned 1200 total points
ID: 17839477
Hello jribble,

I am not sure what kind of detail you are looking for but basically what you would do is the following:

- Rename your current Main Dialog resource to something like IDD_TAB_1
- Make a new Main Dialog resource with a large tab control on it
- Make your tab 2 dialog in another resource
- Create a custom CTabCtrl class CMyTabCtrl for example
- In CMyTabCtrl create the 2 'child' dialog IDD_TAB_1 and IDD_TAB_2 and toggle there visibility based on which tab is selected.
- In the OnInit.. of the main dialog insert the two tabs into your control.

This is the idea if you want more detail let me know.

MAC
0
 
LVL 1

Expert Comment

by:mac-will01
ID: 17839488
I found this it pretty much explains it.

http://www.codersource.net/mfc_ctabctrl.html
0
 
LVL 22

Assisted Solution

by:mahesh1402
mahesh1402 earned 800 total points
ID: 17839939
This one also a simple example with src to refer :
Creating a CTabCtrl Application : http://www.codeguru.com/Cpp/controls/controls/tabcontrols/article.php/c5239/

-MAHESH
0
 

Author Comment

by:jribble
ID: 17845401
MAC,

Your general approach was right on.  

MAC/MAHESH,

The examples were very helpful.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month16 days, 17 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question