Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Could anyone help me change the font here? thanks

C#
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:

C#
<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>
Posted
Updated 19-Dec-16 0:39am

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[^]
 
Share this answer
 
Read -> Text and Fonts[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900