Solved

CTabCtrl wont display in CPropertyPage

Posted on 1997-03-28
7
640 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
[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
  • 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

623 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