gpt4 book ai didi

visual-c++ - 静态文本字体参数更改

转载 作者:行者123 更新时间:2023-12-04 06:43:31 27 4
gpt4 key购买 nike

我正在通过使用表单设计器编辑 .rc 文件为 MFC 类创建对话框表单。我有 Dialog 表单和标签。

enter image description here

找不到如何更改标签的字体。

在属性窗口中,我看到:

enter image description here

但是没有字体属性。他们在哪里?

最佳答案

你必须为此编写代码。
例如

CFont font;
font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("Arial")); // lpszFacename

GetDlgItem(IDC_STATIC1)->SetFont(&font);

MSDN Link

Example

关于visual-c++ - 静态文本字体参数更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40584587/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com