怎样在工具栏的按钮里只显示文字,不显示图标,并且文字要居中

解决方案 »

  1.   

    m_wndToolBar1.CreateEx(this,  TBSTYLE_FLAT , WS_CHILD | WS_VISIBLE |
                              CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
      CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
    // cmd ID
    UINT IDArray[]={ID_BT_1,ID_SEPARATOR,ID_BT_2,ID_SEPARATOR,
                ID_BT_3,ID_SEPARATOR,ID_BT_4,ID_SEPARATOR,
    ID_BT_5,ID_SEPARATOR,ID_BT_6,ID_SEPARATOR,
    ID_BT_7,ID_SEPARATOR,ID_BT_8,ID_SEPARATOR,ID_BT_9};       
        int nIDCount = sizeof(IDArray)/sizeof(UINT);
    m_wndToolBar1.SetButtons(IDArray,nIDCount);
    for(int jj=0;jj<nIDCount;jj++)
    {// have to be inside 'for' !!! if text under img
    m_wndToolBar1.SetSizes(CSize(28,28),CSize(1,1));// 图标 只 1点
    if (m_wndToolBar1.GetButtonStyle(jj) == TBBS_SEPARATOR) continue;
    m_wndToolBar1.SetButtonText(jj,"测试");
    }
      

  2.   

    SetSizes(CSize(28,28),CSize(1,1) // 按钮 高度