如何在MFC的工具栏中添加纯文本按钮 [英] How to add a Text-only button in a toolbar in MFC

查看:90
本文介绍了如何在MFC的工具栏中添加纯文本按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


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


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

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

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

谢谢

推荐答案

尝试将-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");

这篇关于如何在MFC的工具栏中添加纯文本按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆