?
Solved

Tab Control

Posted on 2003-12-12
7
Medium Priority
?
485 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
[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
  • 2
7 Comments
 
LVL 48

Accepted Solution

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

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 248 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

770 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