Spacing difference in a label

I am creating a control that contains multiple controls within it. One of the child controls is a simple lable that I have set to 'inherit' the Text property of the main control through proper get/set activity on the parent. All that is fine and well, but the content of the label control ends up getting really weird spacing the further to the right the text goes. I uploaded an image and link to it here. In the image you can see how 'information' looks different in the second instance vs the first on any single line. Any ideas


Answer this question

Spacing difference in a label

  • Vishwas Lele

    OK - I am using 2.0, but the FlatStyle property did the trick. What's up with that

  • _SteveH_

    Using any FlatStyle other than System will make label (and other controls that have FlatStyle property) to use System.Drawing (GDI+) for drawing text. If you use System the operating system will do the drawing using GDI. GDI+ is a bit broken at drawing text Sad... (altough I'm not 100% sure about this in 2.0)
  • Krispi

    In v2.0 all Winform controls can render text using the newly added TextRenderer API which is GDI-based.  Look at Application.SetCompatibleTextRenderingDefault method or Label.UseCompatibleTextRendering property.

  • RyanT5000

    What .NET version are you using If it's 1.1 try setting FlatStyle property to System or make the label wider, maybe it helps.


  • Spacing difference in a label