MikMik
MikMik

Reputation: 3466

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


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

Upvotes: 1

Views: 3718

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 263077

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");

Upvotes: 5

Related Questions