如何在 WinApi C++ 中更改控件的字体? [英] How do I change the font of a control in 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屋!