Solved

Adding a CTabCtrl to an existing dialog based application

Posted on 2006-10-30
4
551 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 300 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 200 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

808 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