Windows Develop Bookmark and Share   
 index > Windows Forms General > ClearType in Windows Forms
 

ClearType in Windows Forms

Hello,

I would like to use ClearType in a Winforms application, and have a couple of questions regarding:

I. Is it possible to set this property on Microsoft's Winforms controls such as text box and rich text box, or do I have to write my own GDI+ controls to draw text with cleartype text rendering hint?

2. Does this issue become irrelevant in Vista? I read somewhere that text smoothing will be afeature set by the OS for default text rendering- not just in the WPF API. So it's a feature controlled by the user at the OS level in Vista and the winforms apps will all have cleartype if OS is set to such.

thanks, Jake

Jake Michel  Tuesday, January 09, 2007 6:56 PM

WinForms controls use whatever antialiasing mode is set in Display Properties (on both Windows XP and Windows Vista) so you don't need to do your owndrawing unless you want to override that setting (which you should avoid).

The main difference when it comes to Win XP/Vista is that Vista has ClearType turned on by default while WinXP does not.

Mike Danes  Tuesday, January 09, 2007 7:12 PM
Hi,

Is there any way through which I can draw fonts in my winform in CLEARTYPE even if the user has selected otherwise?

Thanks
sujit1779  Saturday, August 22, 2009 2:10 PM
Hi ,

I solved this issue by over-riding paint method of LABEL and used TextRenderer method of graphics.
  • Proposed As Answer bysujit1779 Friday, September 25, 2009 5:23 PM
  •  
sujit1779  Friday, September 25, 2009 5:23 PM
That shouldn't be necessary. Does the label have UseCompatibleTextRendering set to true? TextRenderer is a wrapper around GDI text drawing APIs, but if UseCompatibleTextRendering is false controls will use GDI anyway.
dekurver  Friday, September 25, 2009 5:31 PM

You can use google to search for other answers

Custom Search

More Threads

• Replicate Large Text editing as seen in visual studio
• Why is my multiline text box selected when I run my app?
• Unable to read icons from ImageLists
• how to implement (shift | Mouse) Click select in Data Grid?
• open a new window using javascript
• Can a Listbox do this?
• User resizing PictureBox at runtime
• Closing all forms but one
• Problem with SetInputToDefaultAudioDevice() class system.speech
• how can I set the value of "SPI_SETFOREGROUNDLOCKTIMEOUT" to 0 using SystemParametersInfo()