Solved

CTabCtrl wont display in CPropertyPage

Posted on 1997-03-28
7
630 Views
Last Modified: 2013-11-20
It is simple enougth to use a tab control in a resource based dialog, Just use class wizard to add a CTabCtrl member variable to the tab control then initialize the control   the onInitDialog message handler.

If this approach is used on a resource based CPropertyPage  the the tab control does not display.

How do I get a tab control with an associated CTabCtrl  to display inside a CPropertyPage ?
0
Comment
Question by:ericpa
  • 4
  • 3
7 Comments
 

Author Comment

by:ericpa
ID: 1300709
Edited text of question
0
 

Author Comment

by:ericpa
ID: 1300710
Adjusted points to 133
0
 
LVL 2

Accepted Solution

by:
sapek earned 130 total points
ID: 1300711
This is not a problem with CPropertyPage. I added a tab control to my property page tamplete and the following code to my CPropertyPage derived class OnInitDialog()

TC_ITEM tcItem = {TCIF_TEXT, 0, 0, "Ogólne"};
m_tab.InsertItem(0, &tcItem);

The tab control displays beautifully.
Please try removing everything else from he template but the tab control. If this still doesn't work, check the styles of your dialog and tab control. Here is simplified template of the property page I check it on:

IDD_QUERY DIALOG DISCARDABLE  100, 100, 226, 177
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Warunek"
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "Tab1",IDC_TAB1,"SysTabControl32",0x0,167,31,50,30
END

Adam
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:ericpa
ID: 1300713
I'm not sure but I think that it is not that tab control must be first but must be before a group box around it.

Adam
0
 
LVL 2

Expert Comment

by:sapek
ID: 1300714
yes you are right. I have tried having group boxes before (in the tab order) the tab control and as long as the group box is not around the tab it all works.

The final solution is that to use a CTabCtrl in a CpropertyPage you must ensure that if the tab control is inside a group box then it must come before the group box in the tab order.
0
 

Author Comment

by:ericpa
ID: 1300715
In fact I new that when I was first answering your question. The same effect you see with some other controls in a group box (new common control? I haven't check that excactly). I didn't write about this because you can see this effect in VC resource editor preview mode and I thought that you must have previewed your dialog and then you would see that this is not a CPropertyPage problem.

Adam
0
 
LVL 2

Expert Comment

by:sapek
ID: 1300716
Adam,

I did notice that I could not see the tabs in preview but as I had not used common controls before I assumed that it was because I had not added any tabs to the control. Thank you for pointing this out to me I will be more carefull when using the new common controls.

Regards Eric
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 41
Complete beginner needs help making a cron job 9 125
zeroMAx challenge 20 111
sumHeights  challenge 17 73
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 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