如何更改wxWidgets中的StatusBar字体颜色? [英] How to change StatusBar font color in wxWidgets?

查看:459
本文介绍了如何更改wxWidgets中的StatusBar字体颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户操作导致错误,我想在状态栏上以红色显示错误消息。我已经尝试将背景颜色设置为红色,但它仍然以默认的黑色字体显示消息。如何使状态栏上的字体颜色为红色?我正在使用wxWidgets 2.8上的红帽子5.5

I want to display an error message in red on status bar if a user action results in error. I have tried setting the forground color to red but the it still displays the message in default black font. How do make the font color red on statusbar? I'm using wxWidgets 2.8 on red hat 5.5

谢谢!

Thanks!

推荐答案

<从wxWidget论坛找到答案:

Found out the answers from wxWidget forum:

this->StatusBar->SetForegroundColour(wxColour(wxT("RED")));
wxStaticText* txt = new wxStaticText( this->StatusBar, wxID_ANY,wxT("Validation failed"), wxPoint(10, 5), wxDefaultSize, 0 );
txt->Show(true);

这篇关于如何更改wxWidgets中的StatusBar字体颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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