How to add a Text-only button in a toolbar in MFC

China☆狼群 提交于 2020-01-03 04:00:08

问题



I need to show a text-only button in a toolbar in MFC. How can I do it?

I'm using Visual Studio 2005, so I'm not using MFC Feature Pack classes.

Thanks


回答1:


Try passing -1 as the image index and setting the button's text flag:

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


来源:https://stackoverflow.com/questions/3941193/how-to-add-a-text-only-button-in-a-toolbar-in-mfc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!