[英]Static control get text color
On Windows, once a Static control has been painted (it is already shown), how can we retrieve its text color ?在 Windows 上,一旦绘制了静态控件(已显示),我们如何检索其文本颜色?
I have tried with GetTextColor(), GetDCPenColor() but they don't work.我尝试过使用 GetTextColor()、GetDCPenColor(),但它们不起作用。
thanks谢谢
GetSysColor(COLOR_BTNTEXT)
or GetThemeColor
if you are using Visual Styles.如果您使用视觉样式,则
GetSysColor(COLOR_BTNTEXT)
或GetThemeColor
。 A subclassed control might change the default by handling WM_CTLCOLORSTATIC
.子类控件可能会通过处理
WM_CTLCOLORSTATIC
来更改默认值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.