Solved

CTabCtrl wont display in CPropertyPage

Posted on 1997-03-28
7
616 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

16 Experts available now in Live!

Get 1:1 Help Now