|
我在对话框中添加一个工具栏能够显示,但是添加多个就显示不了,仍然只显示第一个
if (!m_wndToolBar1.CreateEx( this,TBSTYLE_FLAT , WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY|CBRS_SIZE_DYNAMIC,CRect(4,4,0,0)) || !m_wndToolBar1.LoadToolBar(IDB_TOOLBAR1) )
{
TRACE0("failed to create toolbar\n");
return FALSE;
}
m_wndToolBar1.SetBarStyle(m_wndToolBar1.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar1.ShowWindow(SW_SHOW);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
if (!m_wndToolBar2.CreateEx( this,TBSTYLE_FLAT , WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY|CBRS_SIZE_DYNAMIC,CRect(4,4,0,0)) || !m_wndToolBar2.LoadToolBar(IDB_TOOLBAR2) )
{
TRACE0("failed to create toolbar\n");
return FALSE;
}
m_wndToolBar2.SetBarStyle(m_wndToolBar2.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar2.ShowWindow(SW_SHOW);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
问:怎么才能使第二个工具栏显示出来?
|
|