This is my code for CMFCOutlookBarTabCtrl:
BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, int nInitialWidth/* = 250*/)
{
//Outlookbar Style
bar.SetMode2003(FALSE);
BOOL bNameValid;
CString strTemp;
bNameValid = strTemp.LoadString(IDS\_SHORTCUTS);
ASSERT(bNameValid);
//Creating OutlookBar
if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS\_CHILD | WS\_VISIBLE | CBRS\_LEFT))
{
return FALSE; // fail to create
}
//retrieving OutlookBarTabCtrl pointer
CMFCOutlookBarTabCtrl\* pOutlookBar = (CMFCOutlookBarTabCtrl\*)bar.GetUnderlyingWindow();
if (pOutlookBar == NULL)
{
ASSERT(FALSE);
return FALSE;
}
pOutlookBar->EnableInPlaceEdit(TRUE);
//Creating Tab Panes
DWORD dwPaneStyle = AFX\_DEFAULT\_TOOLBAR\_STYLE | CBRS\_FLOAT\_MULTI;
// can float, can autohide, can resize, CAN NOT CLOSE
DWORD dwStyle = AFX\_CBRS\_FLOAT | AFX\_CBRS\_AUTOHIDE | AFX\_CBRS\_RESIZE;
static UINT uiPageID = 10;
\_m\_OutlookPane1.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
\_m\_OutlookPane1.SetOwner(this);
\_m\_OutlookPane1.EnableTextLabels();
\_m\_OutlookPane1.EnableDocking(CBRS\_ALIGN\_ANY);
//\_m\_OutlookPane1.SetDefaultState();
pOutlookBar->AddControl(&\_m\_OutlookPane1, \_T("Scene\*"), 0, TRUE, dwStyle);
\_m\_OutlookPane2.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
\_m\_OutlookPane2.SetOwner(this);
\_m\_OutlookPane2.EnableTextLabels();
\_m\_OutlookPane2.EnableDocking(CBRS\_ALIGN\_ANY);
//\_m\_OutlookPane2.SetDefaultState();
pOutlookBar->AddControl(&\_m\_OutlookPane2, \_T("Walls\*"), 1, TRUE, dwStyle);
\_m\_OutlookPane3.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
\_m\_OutlookPane3.SetOwner(this);
\_m\_OutlookPane3.EnableTextLabels();
\_m\_OutlookPane3.EnableDocking(CBRS\_ALIGN\_ANY);
//\_m\_OutlookPane3.SetDefaultState();
pOutlookBar->AddControl(&\_m\_OutlookPane3, \_T("Furnitures\*"), 2, TRUE, dwStyle);
\_m\_OutlookPane4.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
\_m\_OutlookPane4.SetOwner(this);
\_m\_OutlookPane4.EnableTextLabels();
\_m\_OutlookPane4.EnableDocking(CBRS\_ALIGN\_ANY);
//\_m\_OutlookPane4.SetDefaultState();
pOutlookBar->AddControl(&\_m\_OutlookPane4, \_T("Decorations\*"), 3, TRUE, dwStyle);
\_m\_OutlookPane5.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
\_m\_OutlookPane5.SetOwner(this);
\_m\_OutlookPane5.EnableTextLabels();
\_m\_OutlookPane5.EnableDocking(CBRS\_ALIGN\_ANY);
//\_m\_OutlookPane5.SetDefaultState();
pOutlookBar->AddControl(