问题
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