Formatting text in WinForm Label

That’s not possible with a WinForms label as it is. The label has to have exactly one font, with exactly one size and one face. You have a couple of options:

  1. Use separate labels
  2. Create a new Control-derived class that does its own drawing via GDI+ and use that instead of Label; this is probably your best option, as it gives you complete control over how to instruct the control to format its text
  3. Use a third-party label control that will let you insert HTML snippets (there are a bunch – check CodeProject); this would be someone else’s implementation of #2.

Leave a Comment