Display simple markup in a Label in Delphi

JvHTLabel in the JVCL will do the trick very nicely. Download the whole library from http://jvcl.delphi-jedi.org/


If you are already using a newer version of Delphi (at least the XE2 version), you can take a look at my TDzHTMLText component at: https://github.com/digao-dalpiaz/DzHTMLText

This component is a label with some HTML tags support, allowing you to format the text with Bold, Italic, Underline, Font Color, Font Size, Background Color, Tab Alignment, Text Alignment (left, center, right).

Check a print example:

DzHTMLText component example at design-time

The list below describes all possible tags to format label text:

<A[:abc]></A> - Link
<B></B> - Bold
<I></I> - Italic
<U></U> - Underline
<S></S> - Strike out
<FN:abc></FN> - Font Name
<FS:123></FS> - Font Size
<FC:clColor|$999999></FC> - Font Color
<BC:clColor|$999999></BC> - Background Color
<BR> - Line Break
<L></L> - Align Left
<C></C> - Align Center
<R></R> - Aligh Right
<T:123></T> - Tab
<TF:123></TF> - Tab with aligned break

Check the THtmlViewer components are free and compatible with delphi 2010.


One more:

Delphi Markup Label

The Delphi Markup Label is a label component for Delphi that supports some HTML-like tags to format the displayed text. Amongst others, it supports tags for hyperlinks, tabs, font size, color and styles. The full list of tags can be found in the accompanying test tool.

http://www.infintuary.org/stlabel.php Single pas file, compiled demo included. Some formatting is implemented via self-made tags so it won't be classic HTML. Has no transparence.

Tags:

Delphi