Click to See Complete Forum and Search --> : Adding controls to CTabCtrl - 3rd post


arun
October 8th, 1999, 02:20 PM
can anyone out there explain the best way to add controls to a CTabCtrl? Is there any way to do it using the dialog editor? So far, no one has been able to help. If you can, I would really appreciate it. Thanks a lot in advance.

Arun

JohnCz
October 8th, 1999, 05:01 PM
You can do it in the editor, by inserting tab control to existing dialog, invoking ClassWizard to add member variables. Class Wizard will show you CTabCtrl as a type, this will subclass tab control for you.
Use that dialog as regular dialog or form view.
You will have to create tabs.
You can add as many controls as you need, but you will be responsible for showing/hiding them as different tabs are selected.
Why not to use property sheet and property pages?

arun
October 8th, 1999, 05:07 PM
I need the tabs as part of a larger CFormView, with other controls on it. I was told that I could not use prop sheet/page for this. I have added a CTabCtrl member variable to the CFormView derived class, and have created the tabs, but how do I easily put controls on them? Is there any way to do it through the dialog editor?

Thanks a lot for your help.

Arun

JohnCz
October 8th, 1999, 05:36 PM
I really don’t know who told you that you can’t use Property sheet in a form view.

If you need only tabbed control, you can use property sheet embedded directly in the frame!
There is article I wrote and many more once you go to a property sheet in "Controls related source code sections" from a home page http://www.codeguru.com/.

arun
October 11th, 1999, 09:50 AM
Thanks! I got it to work.

Arun

XZaapryca
August 18th, 2000, 07:00 PM
HOW did you get his to work? CTabCtrl or propertysheets? I'm hitting a wall here.

yang1126
August 20th, 2000, 09:37 AM
For TabCtrl, maybe the main problem is the order in which controls are created. You should firstly put all the controls in place, then draw a TabCtrl 'embracing' them, or draw TabCtrl first,
then edit .rc manually, just move other ctrls ahead of your TabCtrl. In view.cpp, use ShowWindow simply. It works, but maybe is not the best method.