Solved

CTabCtrl wont display in CPropertyPage

Posted on 1997-03-28
7
621 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
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.

 

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

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

914 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

18 Experts available now in Live!

Get 1:1 Help Now