如何更改静态文本控件(winapi)的字体? [英] How to change the font of static text control (winapi)?

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

问题描述

我目前正在使用Winapi和C ++来编写程序.当我在Visual Stdio 2015中使用rc编辑器(控件位于对话框中)时,我发现静态文本控件没有字体更改器.那么,如何更改静态文本控件(winapi)的字体?

I'm currently using winapi with C++ to make a program. When I was using the rc editor in Visual Stdio 2015 (the control is on a dialog), I found that there's no font changer for static text control. So, How to change the font of static text control (winapi)?

谢谢

推荐答案

无法通过修改资源文件来更改静态控件的字体.您只能更改整个对话框的字体.

It's not possible to change the font of a static control by modifying the resource file. You can only change the font of the whole dialog.

您可以通过发送 WM_SETFONT 消息.可以通过 CreateFontIndirect 创建字体功能.

You can change the font of a static control in runtime, by sending the WM_SETFONT message. A font can be created by the CreateFontIndirect function, for example.

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

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