This topic is now archived and is closed to further replies.

Denix Linelli

Visual C++ 6.0 and dialog resources

Recommended Posts

Denix Linelli    122
I would like to know how to make a tab control work properly. Where are the tabs defined, and how do I get the controls into the tabs? Everything I''ve tried has just gotten a nice set of 5 default tabs named "tab 1" through "tab 5" and no effect whatsoever on any other controls. How is it done?

Share this post

Link to post
Share on other sites
Shannon Barber    1681
I think MS dropped the ball on this one... in delphi or VB or CB, when you add a control on top of a tab control it knows to make the new control a child of the tab control - in VC everything you add is a child of the dialog; which is exactly what you don''t want.

Sooooo, as far as I can tell, you have to create the items inside the tab control with code, probably in the OnInitDialog method

look here

CTabCtrl* m_tabStatus = GetDlgItem(IDC_TAB1);
m_tabStatus.InsertItem(1, "Status1");//Adds a tab

m_tabStatus.InsertItem(2, "Status2");//Adds antoher tab

Share this post

Link to post
Share on other sites