m_wndToolBar的停靠位置初始过程

在mainFrm.cpp中

m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);

EnableDocking的作用是使工具栏能够停靠在窗体客户区的任何地方
其参数有:
CBRS_ALIGN_TOP   Allows docking at the top of the client area.

CBRS_ALIGN_BOTTOM   Allows docking at the bottom of the client area.

CBRS_ALIGN_LEFT   Allows docking on the left side of the client area.

CBRS_ALIGN_RIGHT   Allows docking on the right side of the client area.

CBRS_ALIGN_ANY   Allows docking on any side of the client area.

CBRS_FLOAT_MULTI   Allows multiple control bars to be floated in a single mini-frame window.
分别表示可以停靠的不同位置

m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY)是先设置m_wndToolBar的停靠属性,默认的为任何位置

EnableDocking(CBRS_ALIGN_ANY)是设置窗体可以停靠的位置,但必须包括TOP,因为在DockControlBar(&m_wndToolBar)中
的默认设置是让m_wndToolBar停靠在TOP位置的,如果窗体不允许停靠的话,将会报错。


DockControlBar(&m_wndToolBar)是设置m_wndToolBar的初时停靠位置
void DockControlBar(
   CControlBar* pBar,
   UINT nDockBarID = 0,
   LPCRECT lpRect = NULL
);

 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值