如何在 WinApi C++ 中更改控件的字体? [英] How do I change the font of a control in WinApi C++?

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

问题描述

如何在 win32 API 中更改编辑控件的字体.我希望能够在编辑控件上编辑样式和字体颜色.

How do I change the font of an edit control in win32 API. I would like to be able to edit the style as well as the color of a font on a edit control.

推荐答案

首先,您应该澄清您在谈论标准编辑控件与 Rich Edit 控件 - 两者完全不同.

First you should clarify that you're talking about a standard Edit control versus a Rich Edit control - the two are totally different.

您可以通过发送 WM_SETFONT 来更改字体 消息给编辑控件.设置颜色是一个完全不同的过程.

You can change the font by sending a WM_SETFONT message to the edit control. Setting the color is a totally different process.

您可以通过响应WM_CTLCOLOREDIT 编辑控件所有者中的消息.

You can set the text color by responding to the WM_CTLCOLOREDIT message in the owner of the edit control.

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

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