CXTabCtrl: an easier tab control for dialogs and forms
Posted
by XicoLoKo XicoLoKo
on July 25th, 1999
When I first got in touch with the Microsoft VC, it was boring to put a tab control in a form or in a dialog. I had to create the dialogs, fill in the TCITEM struct for each of my tabs, and finally insert them in the tab control. With the CXTabCtrl what you have to do is ilustrated below:
InitDialog (CDialog) or InitialUpdate (CFormView)
... m_pMyDlg = new CMyDlg; m_pMyDlg->Create(CMyDlg::IDD, &m_tabctrl /*CXTabCtrl variable*/); m_tabctrl.AddTab(m_pMyDlg, "Tab caption", 0 /* image number*/); ...
The OnSelChange that you had to implement in the dialog (or form), to show the correct dialog, now is in the CXTabCtrl, so you don't have to worry about it. You can disable a tab too, so the user cannot see it's contents.
m_tabctrl.EnableTab(1 /*index*/, FALSE);
Also, you can set the following colors:
- Selected tab
- Unselected tab
- Disabled tab
- A mouse over tab

Comments
Great Job
Posted by Legacy on 09/02/2002 12:00amOriginally posted by: S.P.Rewatkar
Thnx,
ReplyThis code help me a lot.
How to use keyboard navigation in attached PropertyPages?
Posted by Legacy on 06/25/2002 12:00amOriginally posted by: Ray A. Akey
How can I make it so that the TAB key changes the focus from the current control in an attached property page to the "next" control in that same property page?
Currently, hitting TAB only make the focus change from the control that currently has focus, to the TAB control.
How do I make the focus go to a different control? e.g. TAB cycle focus through ALL the controls on the dialog and then, finally, to the TAB control?
ReplySimplified Tab Creation Process
Posted by Legacy on 06/20/2002 12:00amOriginally posted by: John Alexiou
Replyno tabs
Posted by Legacy on 11/10/2001 12:00amOriginally posted by: AMW
ReplyI wana get a sample project with FORMVIEW.
Posted by Legacy on 05/27/2001 12:00amOriginally posted by: baldr
I've a problem in selecting tabs in menu command.
Replyhow to remove flicker ?
Posted by Legacy on 04/20/2001 12:00amOriginally posted by: troggan
hi!
i want to use this in a resizable-dialog. but this is flickering terrible. how can i work around that?
thanks
Replytroggan
Hitting "escape" does not cause dialog to shut down...
Posted by Legacy on 05/12/2000 12:00amOriginally posted by: Paul
I'm using the tab class, but when the user hits "escape" the dialog does not shut down.....is there anything I need to do to make this work??
ReplyHow to navigate between tabs using hot keys
Posted by Legacy on 04/13/2000 12:00amOriginally posted by: Akhilesh
Hi,
Is there any way to navigate between tabs,
using Hot keys like Ctrl + Tab.
Thanks
ReplyAkhilesh
Problem with Tabs in DLL
Posted by Legacy on 03/21/2000 12:00amOriginally posted by: Twist
I use your CXTabCtrl class, which is really good, but I have a problem to use it into DLL.
In fact, it's when the application runs the DoDataExchange function, the GetDlgItem doesn't. I tried to use an independant pointer, and not a Claas member of AppWizzard, but the problem is the same : GetDlgItem returns NULL pointer.
If you got a soution, It would be really great. Otherwise, tell it to me.
Thanks in advance
ReplyDialog don't appear in the TabCtrl !!
Posted by Legacy on 03/15/2000 12:00amOriginally posted by: cyril
The Control is really Good, but I have a problem. When I run my program, the Dialog I wanted to put into the TaCtrl appear in the top-left corner of the Screen.
When I change the tab, the Dialog Changes too !!
It's like if it was working, but the Dialogs are not in the TabCtrl
ReplyThanks for your reponse
Loading, Please Wait ...