![]() |
Label and DT_END_ELLIPSIS
Hi i use the following code to show the '...' or ellipsis when the label's caption doesn't fil its width :
Delphi-Quellcode:
Label's width :201
procedure TForm1.Button1Click(Sender: TObject);
var S,M: string; R: TRect; begin M:='or adjust label width'; S := 'this is way too long to fit into a label - trim it down'; UniqueString(S); R := label1.Canvas.ClipRect; label1.Canvas.Font := label1.Font; DrawText(label1.Canvas.Handle, PChar(S), Length(S), R, DT_END_ELLIPSIS or DT_MODIFYSTRING or DT_NOPREFIX); label1.Caption := S; end; Label's autosize : false . the result will be : this is way too long to fit into a label - trim ... But what i want is to add the M value 'or adjust label width ' after the ellipsis so the result will be : this is way too long to fit into a label - trim ...or adjust label width please how could i do this last one . |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz