为什么我的工具条在状态栏的下面?

bourbaki 2003-10-14 11:44:28
我在CMainFrame的OnCreate中有这么一段代码,在窗口底部添加一个工具条:
if (!m_tblBottom.
CreateEx(this, TBSTYLE_BUTTON, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM |CBRS_TOOLTIPS | CBRS_FLYBY |CBRS_SIZE_DYNAMIC)
|| !m_tblBottom.LoadToolBar(IDR_TOOLBAR_BOTTOM)) {
TRACE0("Failed to create bottoom toolbar\n");
return -1;
}
m_tblBottom.EnableDocking(CBRS_ALIGN_BOTTOM);
DockControlBar(&m_tblBottom);

但这个工具条出现在状态条的下面,我想让它放在状态条上面,怎么办?
这个程序是一个单文档的程序。
...全文
34 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
CounterHack 2003-10-21
  • 打赏
  • 举报
回复
这么放就行,我试过了!
OnCreate()
{
... ...
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_tblBottom.
CreateEx(this, TBSTYLE_BUTTON, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM |CBRS_TOOLTIPS | CBRS_FLYBY |CBRS_SIZE_DYNAMIC)
|| !m_tblBottom.LoadToolBar(IDR_TOOLBAR_BOTTOM)) {
TRACE0("Failed to create bottoom toolbar\n");
return -1;
}

// 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);

m_tblBottom.EnableDocking(CBRS_ALIGN_BOTTOM);
DockControlBar(&m_tblBottom);
... ...
}
wuxfBrave 2003-10-14
  • 打赏
  • 举报
回复
DockControlBar(&m_tblBottom);放在创建状态栏后面
bourbaki 2003-10-14
  • 打赏
  • 举报
回复
wuxfBrave,还是不行啊。下面是状态条的创建语句,这是wizard加的。
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1;
}

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧