Solved

Tab Control

Posted on 2003-12-12
7
475 Views
Last Modified: 2009-12-16
I am trying to develop a dialog based application in MFC (Visual C++ .NET). Everything was going okay until I tried to add TAB control to it. The TAB control works fine but none of the extra dialog boxes created for the application can be seen in it.

I have downloaded the example from

http://www.codeproject.com/dialog/embedded_dialog.asp 

and it compiled fine but whenever I try to create my own tab in the project it doesn’t seen to work.

I have downloaded many other sample programs using tab control and have the same problem when I add my own tab.

I open a new dialog box of ‘IDD_PROPPAGE_MEDIUM’ and add a class of ‘Cpropertypage’ to it. This creates a .h and .cpp file for me. The Header file looks completely different to ones created in the examples. ie there is no

#ifndef __DIALOG2_H
#define __DIALOG2_H

I get a very basic file with #pragma once.

If anyone could help I would really appreciate it as it’s driving me mad. I can let you have the source files if needed.
0
Comment
Question by:stevekelly
  • 2
  • 2
7 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 63 total points
ID: 9929564
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 62 total points
ID: 9931740
The CPropertyPage is a separate dialog, it was not inteded to be used on another dialog. The usual way to get a property sheet embedded on a dialog is to create a place holder frame (usually a non-visible, disabled picture control) on the dialog. In the OnInitDialog() method of the dialog you then create the property sheet, and you get the position and size of the placeholder frame. Then you move the CTabCtrl of the property sheet to the position of the placeholder. It's not as simple as adding other controls to your dialog.
You have to study the sample program and mimic what it is doing in your program.

The link posted by AlexFM uses a CTabCtrl derived class, but you have to use this custom class (The CMyTabCtrl).

You can also use a CTabCtrl directly, and still get the same behavior.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10315754
Split between AlexFM and khkremer
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10319546
Agree.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sorting in Excel with Group Headers if the Exist 2 82
firstswap challenge 20 67
White board coding practice 3 78
Regular Expression Calculator Tester 2 54
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is about my first experience with programming Arduino.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

911 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

20 Experts available now in Live!

Get 1:1 Help Now