Solved

Adding a CTabCtrl to an existing dialog based application

Posted on 2006-10-30
4
569 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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

687 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