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: Use separate labels 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 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.

Not really, but you could fake it with a read-only RichTextBox without borders. RichTextBox supports Rich Text Format (rtf).

Create the text as a RTF file in wordpad Create Rich text control with no borders and editable = false Add the RTF file to the project as a resource In the Form1_load do myRtfControl. Rtf = Resource1. MyRtfControlText.

I Would also be interested in finding out if it is possible. When we couldn't find a solution we resorted to Component Ones 'SuperLabel' control which allows HTML markup in a 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. 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.

Not really, but you could fake it with a read-only RichTextBox without borders. RichTextBox supports Rich Text Format (rtf). Rtf = Resource1.

I Would also be interested in finding out if it is possible. When we couldn't find a solution we resorted to Component Ones 'SuperLabel' control which allows HTML markup in a label. There is an excellent article from 2009 on Code Project named "A Professional HTML Renderer You Will Use" which implements something similar to what the original poster wants.

I use it successfully within several projects of us.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions