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
Solved

Tab Control

Posted on 2003-12-12
7
479 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
recursion example 16 139
tvirtualstringtree freeze when load too manny images 10 71
Base1 Encode/Decode 3 81
Android development question 2 52
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

808 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