Solved

Tab Control

Posted on 2003-12-12
7
473 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
Comment Utility
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 62 total points
Comment Utility
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
Comment Utility
Split between AlexFM and khkremer
0
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
Agree.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Adobe Customization Wizard XI issues 26 164
commonTwo  challenge 63 98
sumDigits  challenge 7 60
Base1 Encode/Decode 3 21
Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
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 …

744 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

10 Experts available now in Live!

Get 1:1 Help Now