c++ - 如何为 wxWidgets wxBitmapButton 添加标签?

标签 c++ visual-c++ user-interface wxwidgets wxformbuilder

如何使用 wxWidgets 创建一个既有标签(文本)又有图像或图标的按钮。如果我选择 wxBitmapButton,则会有一个名为“label”的字段。但是每当我在该字段中写入任何内容时,它都不会更新 wxFormBuilder 中的代码。我也试过 wxButton->SetLabel() 但没有成功。

如有任何帮助或建议,我们将不胜感激。

最佳答案

您只能在 wxWidgets 2.9.1 或更高版本中执行此操作,并且可以使用 wxBitmapButton 或 wxButton。引用自documentation :

Since version 2.9.1 wxButton supports showing both text and an image (currently only when using wxMSW, wxGTK or wxOSX/Cocoa ports), see SetBitmap() and SetBitmapLabel(), SetBitmapDisabled() methods. In the previous wxWidgets versions this functionality was only available in (the now trivial) wxBitmapButton class which was only capable of showing an image without text.

关于c++ - 如何为 wxWidgets wxBitmapButton 添加标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14509056/

相关文章:

c++ - Qt 中的可伸缩图形用户界面

android - 在android中动态添加UI内容

c++ - 在 C++ 中一次从输入文件中读取一个单词

c++ - 使用 protobuf 反射在 C++ 中获取 bool 字段描述符

c++ - 双向链表混淆

visual-studio - 解决方案资源管理器未显示在 Microsoft Visual Studio 中

c++ - 属性通知更改在 C++/CX 绑定(bind)中等效

c++ - 使用共享指针时是否需要设置析构函数方法?

购买多个相同项目时的 ios 应用内购买

c++ - 防止参数包扩展中的数组衰减