?
Solved

Adding a CTabCtrl to an existing dialog based application

Posted on 2006-10-30
4
Medium Priority
?
594 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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