tags:

views:

166

answers:

2
Application.SetCompatibleTextRenderingDefault(false);

Error : Before the establishment of the first object IWin32Window in the annex to call SetCompatibleTextRenderingDefault.

why error ? how to avoid ? and ... what SetCompatibleTextRenderingDefault actually makes :)

+1  A: 

As the docs state, you have to call this before creating your first window.

It sets the default rendering engine for some controls: GDI if true, GDI+ (newer) if false. This is a compatibility switch: if you want to keep the .NET 1 behaviour of these controls, do not call this function; if you want the newer behaviour, call it with false as a parameter.

Timores
but can I ever use it in console application ? because I had a try set it right after main() {
nCdy
If you are writing a console application, you do not need to call this function, it would have no effect if it succeeded.
Timores
A: 

defaultValue Type: System.Boolean The default value to use for new controls. If true, new controls that support UseCompatibleTextRendering use the GDI+ based Graphics class for text rendering; if false, new controls use the GDI based TextRenderer class.

Maloy Adhikari