visual studio 2008 - Enable Windows Cleartype for MFC text controls created at runtime -


I have an MFC communication program in which I make some CSTIT and CEDT controls on the runtime. Either way, in these controls the text is not cryptic (type of claytype, sub-pixel positioning and color combines texts by color).

However, when someone manually controls "Control Edit" or "Static Text" from the Visual Studio Toolbox, the controls on design time have these controls clean-typed.

Are somehow different from the controls created from the toolbox on the runtime? Does anyone know how to enable Cleistype for the text controls created at runtime? One of the code snippets of the creation of a CSTicate control in the opencart function of the dialog is:

  CRect CRC; Crc.SetRect (100, 10, 300, 40); M_static.Create (_T ("Personeelsnummer?"), WS_CHILD | WS_VISIBLE, CRC, this, IDC_STATIC1);  

The text in this CStatic control is not Cleartype enabled

I have answered my own question: The lack of clefty on the controls created on runtime is fonts-related. When a control creates control over the runtime, a default font is used which is unaffected by the claytype and should be replaced with a different font.

In my question I noticed that I tried to set a different font, although I made a font in the local function. The font was deleted after the font was exited from the function to be set, so I did not get any differences. Now I have a class member variable for the font which only gets destroyed when the original CWD is destroyed.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -