I tried applying VCLStyle to TLinkLabel.
Sorry, I canโt display the underscore (sentece of Tag)
TLinkLabel.Caption := 'Sma<a>pl</a>e';
How did I solve this?
To solve this problem, but the tag does not seem likely, this "example" 
procedure TgLinkLabelHook.Paint(Canvas: TCanvas); var LDetails: TThemedElementDetails; ParseStr: String; DrawRect: TRect; DC: HDC; TextSize: TSize; SaveFont: HFont; ThemeTextColor: TColor; begin ParseStr := ParseLinks; LDetails := StyleServices.GetElementDetails(tbPushButtonPressed); DC := GetDC(0); try SaveFont := SelectObject(DC, TLinkLabel(Control).Font.Handle); try GetTextExtentPoint32(DC, PWideChar(ParseStr), Length(ParseStr), TextSize); finally SelectObject(DC, SaveFont); end; finally ReleaseDC(0, DC); end; Canvas.Font := TLinkLabel(Control).Font; Canvas.Font.Style := Canvas.Font.Style + [fsUnderline]; Canvas.Font.Size := TLinkLabel(Control).Font.Size; if StyleServices.GetElementColor(LDetails, ecBodyTextColor, ThemeTextColor) then Canvas.Font.Color := ThemeTextColor; // DrawRect := Rect(0, 0, TextSize.cx, TextSize.cy); DrawRect := Control.ClientRect; DrawControlText(Canvas, LDetails, ParseStr, DrawRect, DT_VCENTER or DT_CENTER); end; procedure TForm8.FormCreate(Sender: TObject); begin TStyleManager.Engine.RegisterStyleHook(TLinkLabel, TgLinkLabelHook); end;
source share