2 gx15366039985 gx15366039985 于 2015.07.13 12:20 提问

VS2010 默认单文档OutlookBar的设置问题

图片说明
BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, CMFCShellTreeCtrl& tree, CCalendarBar& calendar, int nInitialWidth)
{
bar.SetMode2003();

BOOL bNameValid;
CString strTemp;
bNameValid = strTemp.LoadString(IDS_SHORTCUTS);
ASSERT(bNameValid);
if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
{
    return FALSE; // 未能创建
}

CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();

if (pOutlookBar == NULL)
{
    ASSERT(FALSE);
    return FALSE;
}

pOutlookBar->EnableInPlaceEdit(TRUE);

static UINT uiPageID = 1;

// 可浮动,可自动隐藏,可调整大小,但不能关闭
DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE;

CRect rectDummy(0, 0, 0, 0);
const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

tree.Create(dwTreeStyle, rectDummy, &bar, 1200);
bNameValid = strTemp.LoadString(IDS_FOLDERS);
ASSERT(bNameValid);
pOutlookBar->AddControl(&tree, strTemp, 2, TRUE, dwStyle);

calendar.Create(rectDummy, &bar, 1201);
bNameValid = strTemp.LoadString(IDS_CALENDAR);
ASSERT(bNameValid);
pOutlookBar->AddControl(&calendar, strTemp, 3, TRUE, dwStyle);

bar.SetPaneStyle(bar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24);
pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16);
pOutlookBar->RecalcLayout();

BOOL bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE);
CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);

bar.SetButtonsFont(&afxGlobalData.fontBold);

return TRUE;

}
通过什么函数能对导航栏选项进行更改。比如添加选项,在选项中能修改图标、名称等。

2个回答

gx15366039985
gx15366039985   2015.07.13 12:21

另外文件夹中不需要存在Tree函数类型的菜单。

gx15366039985
gx15366039985   2015.07.13 16:29

怎么都没人来解答呢,嫌麻烦?

Csdn user default icon
上传中...
上传图片
插入图片