要想工具栏变成飘浮在主窗口,不系甘用的,如有兴趣请与wealth联系。

解决方案 »

  1.   

    m_wndToolBar->EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(m_wndToolBar);
    将以上都注释掉
      

  2.   

    问题我是想先使之Docking, 再使之不Docking, 楼上的大概没领会我的意思吧~~To wealth: "不系甘用的"是什么意思?怎么和你联系?我也不是想把ToolBar变成浮动的~~我想还原~~
      

  3.   

    你把原来的ToolBar删除掉,
    然后重新创建一个,
    不知行不行,呵呵
      

  4.   

    To alphagx: 又是你啊~~你说的没错~~~不过太笨了~~这种方法你也想得出???就没有别的啦?
      

  5.   

    To jiangsheng: CFrameWnd* FloatControlBar( CControlBar * pBar, CPoint point, DWORD dwStyle = CBRS_ALIGN_TOP );dwStyle只有四个选项, up, bottom, left, top~~~顺便问一句: jiangsheng是QQ网络社团->程序员驿站的网管吗?我记得在那里见过你的~~
      

  6.   

    呵呵,怎么到处被抓到?重点在那个point,dwStyle是用来指定工具栏的方向的。
      

  7.   

    我发现StatusBar和ToolBar都有许多不稳定的地方,谁能解释一下?
      

  8.   

    To jiangsheng: 果然是哈~~~重点在Point??不懂, 那只是个位置啊~~~~~~
    To chengbuaa: 我也发现了~~但不知道为什么?尤其是它的拖动问题, 绝对有毛病`~~~
      

  9.   

    我有源程序
      上面的都不好, 告诉我EMAIL吧
    我跟踪源码N小时,终于帮你搞定了!
      

  10.   

    啊啊!!!!喜极流悌`~but欲哭无泪啊~~~~~~呵呵~~~~~
    [email protected]
    也给我你的E-mail吧, 以后有问题先问你了~~~
      

  11.   

    To alphagx: CDockContext是个什么类啊?Msdn怎么查不到?
      

  12.   

    这是我跟踪源程序得到的, 
    可废了我不少心血。
    这是为了用来处理ToolBar的Dockable
      

  13.   

    To alphagx:
    我也正在看afxpriv.h中的各个类, 可惜Msdn里没有~~~~
    CDockContext不能直接构造类变量, 难道为了"停靠"还要重载这个类才能实现吗?我不太明白~~~
      

  14.   

    你跟进去他的源码, 
    你就知道了, 
    我主要的处理就是在禁止了他的StartDrag函数
    有问题,写EMAIL
    联系吧
      

  15.   

    To alphagx: 我看了程序的代码了(头都大了), 给你发E-mail了, 我觉得那个方法挺笨的, 难道就没有更好的方法了吗?有EnableDocking(),就没有DisableDocking()吗?微软难道比我还笨吗?
      

  16.   

    收到我给你发的邮件了吗? 真的没有这方面的函数吗? 你给我的那个程序是比较原始的那种, 即非Docking就让ToolBar归位, 然后截掉它的拖动消息~~~~不管了~~先就这么做吧~~~谢了~~贴子结不了帐, 又欠你好多分了~~~等着吧~~~~~急也没用哈~~~
      

  17.   

    请看msdn的说明dwStyle 
    Specifies whether the control bar supports docking and the sides of its parent window to which the control bar can be docked, if supported. Can be one or more of the following flags: 
    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. 
    If zero, that is, indicating no flags, the control bar does not dock. 
    ----------------------------------
    好像只要传0进去就可以了
      

  18.   

    To klhu: 不行的, 我试过了~~设置成0它变成非Docking但是是Floating的了, 而我想二者均非~~~
      

  19.   

    UP UP!
    我要分分!
    我要分分!