HTML formatted label in winforms? [modified]
-
is there a label control that can support bold or different color on the same line. by using tags like in HTML? sample: This is a test for bold and this for color i want to implement this without using richtextbox can anyone please help :) -- modified at 5:34 Friday 11th August, 2006
-
is there a label control that can support bold or different color on the same line. by using tags like in HTML? sample: This is a test for bold and this for color i want to implement this without using richtextbox can anyone please help :) -- modified at 5:34 Friday 11th August, 2006
As far as I know there is not such a control. You could, however, write this yourself fairly easily. One approach is to derive a class from Control. Your Text property would contain the text with any meta tags that you would define. In your OnPaint method you would render your text with colors, fonts, etc. based on any meta tags you may have. I hope this helps. -- modified at 22:48 Thursday 10th August, 2006 -- modified at 22:48 Thursday 10th August, 2006
Deus caritas est
-
As far as I know there is not such a control. You could, however, write this yourself fairly easily. One approach is to derive a class from Control. Your Text property would contain the text with any meta tags that you would define. In your OnPaint method you would render your text with colors, fonts, etc. based on any meta tags you may have. I hope this helps. -- modified at 22:48 Thursday 10th August, 2006 -- modified at 22:48 Thursday 10th August, 2006
Deus caritas est
thanks for replying Andy :) as i am new to c# i dont have the idea how to do it or where to start:) can you please point me to an article how to check for the tags and implement the rendering of text using the OnPaint method.
-
thanks for replying Andy :) as i am new to c# i dont have the idea how to do it or where to start:) can you please point me to an article how to check for the tags and implement the rendering of text using the OnPaint method.
There are copious articles at CodeProject and on the web that explain how to draw custom controls in C#. Look at the Graphics class for drawing on a control's surface.
Deus caritas est
-
is there a label control that can support bold or different color on the same line. by using tags like in HTML? sample: This is a test for bold and this for color i want to implement this without using richtextbox can anyone please help :) -- modified at 5:34 Friday 11th August, 2006
Hi, We will have an HTML label and HTML tooltip control available for .NET 2.0, beginning with the T3 2006 release of our controls. For more information on ComponentOne controls, please visit http://www.componentone.com/products.aspx?ItemType=1&TabTypeID=1&PanelIndex=1&TabMapID=8&Itemid=66&Tabid=2&SubCategoryTypeID=0[^].
Suelinda W Customer Engagement, ComponentOne LLC