本帖最后由 dahuatttt 于 2010-01-17 17:35:10 编辑

解决方案 »

  1.   

    command id.譬如ID_FILE_NEW啥的。
      

  2.   

    甚为不解
    我打算用[m_ToolBar.SetButtons(NULL,5);]来建5个按钮,然后分别设置5个按钮的图案和文字等等。所以不明白按钮ID从何获取,如何设置。谢谢
      

  3.   

    SetButtons这个函数就可以设置id,但是你把它置空了。
      

  4.   

    id是自己随便给的,不需要从某个地方获取,只要你保证这个id和其他控件的不一样即可。
    所以你可以自定义一个范围,然后把你自己的控件的id从那个范围开始
      

  5.   

    我隐约觉得你们说得很详细了,但是我不清楚整个逻辑,所以还是无法理解
    SetButtons下
    lpIDArray 
    Pointer to an array of command Ids. It can be NULL to allocate empty buttons.
    If lpIDArray is NULL, this function allocates space for the number of items specified by nIDCount. Use SetButtonInfo to set each item's attributes.
    看到这段我设置成0的。
    目前卡在如何设置上
    随便给的话,我是在SetButtons的时候给的吗?
    UINT nid[]={0xff01,0xff02,0xff03,0xff04,0xff05};
    可以把上面这个放进去吗?
      

  6.   

    你这样,你google一下:动态创建工具条
      

  7.   

    唉。。还是ToolBarCtrl好用啊辛苦大家了!