请帮助改变C ++中的字体 [英] Help change font in C++ please

查看:112
本文介绍了请帮助改变C ++中的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我改变字体吗?谢谢



Could anyone help me change the font here? thanks

ScriptTextBoxHWND = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_BORDER | WS_VSCROLL, 0, 0, 511, 519, MainWindowHWND, (HMENU)MYMENU_SCRIPTTEXTBOX, hInstance, 0);
	SendMessage(ScriptTextBoxHWND, EM_SETLIMITTEXT, 0x7FFFFFFE, 0);
	//TAKEDMG CHECKBOX
}





我的尝试:





What I have tried:

<pre lang="C#">ScriptTextBoxHWND = CreateWindowEx(WS_EX_CLIENTEDGE, L&quot;EDIT&quot;, L&quot;&quot;, WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_BORDER | WS_VSCROLL, 0, 0, 511, 519, MainWindowHWND, (HMENU)MYMENU_SCRIPTTEXTBOX, hInstance, 0);
	SendMessage(ScriptTextBoxHWND, EM_SETLIMITTEXT, 0x7FFFFFFE, 0);
	//TAKEDMG CHECKBOX
}</pre>

推荐答案

简答:只需发送 WM_SETFONT消息(Windows) [ ^ ]到你的窗口。



更详细的说明和必须包含的内容观察到这个SO线程:

winapi - 如何为通过CreateWindow创建的窗口指定字体? - 堆栈溢出 [ ^ ]
Short answer: Just send a WM_SETFONT message (Windows)[^] to your window.

For a more detailed description and what has to be observed see this SO thread:
winapi - How can I specify a font for a window created through CreateWindow? - Stack Overflow[^]


读取 - > 文字和字体 [ ^ ]
Read -> Text and Fonts[^]


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

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