如何将一个toolbar连接到另一个后面

hzlong02 2011-04-13 04:59:59
本人菜鸟,求高手详细解答
...全文
36 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eleven 2011-04-13
  • 打赏
  • 举报
回复
void   CMainFrame::DockControlBarLeftOf(CToolBar*   Bar,   CToolBar*   LeftOf) 
{
CRect rect;
DWORD dw;
UINT n;

// get MFC to adjust the dimensions of all docked ToolBars
// so that GetWindowRect will be accurate
RecalcLayout(TRUE);

LeftOf-> GetWindowRect(&rect);
rect.OffsetRect(1,0);
dw=LeftOf-> GetBarStyle();
n = 0;
n = (dw&CBRS_ALIGN_TOP) ? AFX_IDW_DOCKBAR_TOP : n;
n = (dw&CBRS_ALIGN_BOTTOM && n==0) ? AFX_IDW_DOCKBAR_BOTTOM : n;
n = (dw&CBRS_ALIGN_LEFT && n==0) ? AFX_IDW_DOCKBAR_LEFT : n;
n = (dw&CBRS_ALIGN_RIGHT && n==0) ? AFX_IDW_DOCKBAR_RIGHT : n;

// When we take the default parameters on rect, DockControlBar will dock
// each Toolbar on a seperate line. By calculating a rectangle, we
// are simulating a Toolbar being dragged to that location and docked.
DockControlBar(Bar,n,&rect);
}

15,976

社区成员

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

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