如何设置按钮背景色? [英] how to set Button BackColor?

查看:52
本文介绍了如何设置按钮背景色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改使用 创建窗口?

推荐答案

Windows API 不再提供许多选项来自定义标准控件的外观.

The Windows API does not offer many options to customize the appearance of standard controls anymore.

  • WM_CTLCOLORBTN可以由按钮的父窗口处理以控制按钮外观的某些方面,但 uxtheme 按钮仅使用背景画笔来绘制按钮后面的区域.面部外观由当前主题决定.

  • WM_CTLCOLORBTN can be handled by the parent window of a button to control some aspects of a buttons appearance, but uxtheme buttons only use the background brush to paint the area behind the button. The appearance of the face is determined by the current theme.

WM_DRAWITEM也可以由父窗口处理,通过在按钮上设置 BS_OWNERDRAW 样式.这允许父窗口完全替代普通按钮绘制逻辑.

WM_DRAWITEM can also be handled by the parent window, by setting the BS_OWNERDRAW style on the button. This allows the parent window to completely replace the normal buttons painting logic.

这篇关于如何设置按钮背景色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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