CToolBar添加分隔按钮

#define SEP_IDX 6
    TBBUTTON btn;
    ZeroMemory(&btn, sizeof(TBBUTTON));
    btn.iBitmap = 8;
    btn.fsStyle = TBSTATE_WRAP;
    m_wndToolBar.GetToolBarCtrl().InsertButton(SEP_IDX, &btn);

    TBBUTTONINFO tbbi = { sizeof (TBBUTTONINFO) };
    tbbi.dwMask = TBIF_BYINDEX | TBIF_SIZE;
    tbbi.cx = 30;//按钮宽度
    tbbi.fsStyle = TBSTATE_WRAP;
    m_wndToolBar.SendMessage(TB_SETBUTTONINFO, SEP_IDX, (LPARAM)&tbbi);

你可能感兴趣的:(CToolBar添加分隔按钮)