如何让Dialog Bar位于Tool Bar的上头(Y坐标)
MDI应用中,如何把Dialog Bar放到ToolBar的下面(所谓上下,指的是Y坐标),我的那段代码如下:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndDlgBar.Create(this, IDD_DIALOGBAR,
CBRS_TOP |CBRS_TOOLTIPS|CBRS_FLYBY, IDD_DIALOGBAR))
{
TRACE0("Failed to create DlgBar\n");
return -1; // fail to create
}//here created the Dialog Bar!!!!!
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}//here Created the tool bar!!!!
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
/*
if (!m_wndDlgBar.Create(this, IDD_DIALOGBAR,
CBRS_TOP |CBRS_TOOLTIPS|CBRS_FLYBY, IDD_DIALOGBAR))
{
TRACE0("Failed to create DlgBar\n");
return -1; // fail to create
}
*/
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}