如何改变wxWidgets中StatusBar的字体颜色?

发布于 2024-09-24 16:50:16 字数 127 浏览 0 评论 0原文

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

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温折酒 2024-10-01 16:50:16

从wxWidget论坛找到答案:

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

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文