【问题标题】:Can I change the button background color when the mouse is over the button?当鼠标悬停在按钮上时,我可以更改按钮背景颜色吗?
【发布时间】:2019-12-06 20:15:06
【问题描述】:

我创建了一个带有单个wxbutton 的简单框架,当鼠标悬停在按钮上时,我可以更改按钮背景颜色吗?

var name = Button1
class name = wxButton

如果是这样,谁能向我解释如何一步一步地做到这一点?

【问题讨论】:

  • 取决于 GUI 处理程序的速度。查看绘制和重绘方法。

标签: c++ button wxwidgets background-color


【解决方案1】:

您是否尝试过从 Button(不是您的窗口)捕获 wxEVT_LEAVE_WINDOW 和 wxEVT_ENTER_WINDOW 并在被调用函数中更改 Buttons 背景颜色?

【讨论】:

    猜你喜欢
    • 2017-12-15
    • 2018-05-15
    • 2011-04-04
    • 1970-01-01
    • 1970-01-01
    • 2017-07-28
    • 1970-01-01
    • 2018-07-20
    • 1970-01-01
    相关资源
    最近更新 更多