首页 文章

如何在MFC中的工具栏中添加纯文本按钮

提问于
浏览
1

我需要在MFC的工具栏中显示一个纯文本按钮 . 我该怎么做?

我正在使用Visual Studio 2005,所以我没有使用MFC Feature Pack类 .

谢谢

1 回答

  • 5

    尝试传递 -1 作为图像索引并设置按钮的文本标志:

    toolBar.SetButtonInfo(buttonIndex, buttonId,
        TBBS_BUTTON | TBBS_AUTOSIZE | BTNS_SHOWTEXT, -1);
    toolBar.SetButtonText(buttonIndex, "Button Text");
    

相关问题