Solved

Adding a CTabCtrl to an existing dialog based application

Posted on 2006-10-30
4
539 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now