Display simple markup in a Label in Delphi

前端 未结 5 1352
温柔的废话
温柔的废话 2021-02-13 21:22

I am currently displaying some text in a TLabel. I would now like to emphasise certain words within the text by displaying them in bold or perhaps italic

5条回答
  •  星月不相逢
    2021-02-13 21:44

    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:

     - Link
     - Bold
     - Italic
     - Underline
     - Strike out
     - Font Name
     - Font Size
     - Font Color
     - Background Color
    
    - Line Break - Align Left - Align Center - Aligh Right - Tab - Tab with aligned break

提交回复
热议问题