![]() |
Re: TLabel ½ Zeilenumbruch
Alternativ würde ich einfach mehrere Labels nehmen und diese dann "dynamisch" positionieren... ?! :)
|
Re: TLabel ½ Zeilenumbruch
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:
Zitat:
Delphi-Quellcode:
uses RichEdit;
... Procedure TForm1.DrawRTFLines(aText: TStrings; aGap: Integer); Const // Einfach aus Wordpad geklaut, hier wird aber auch der Font gesetzt. sRTFPreamble = '\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fswiss\fcharset0 Arial;}}' + '\viewkind4\uc1\pard\f0'; sRTFLine = '\fs20 %s\par\fs%d\par'; // /fs20 = Fontgroße 10 (wieso da 20 stehen muss, k.A.) Var sRTF: String; i: Integer; sText: TStringStream; P: TPoint; Begin // RTF-Code erzeugen sRTF := sRTFPreamble; For i := 0 To aText.Count - 1 Do sRTF := sRTF + Format(sRTFLine, [aText[i], aGap]); // RTF muss per Stream/File in das Control geschrieben werden sText := TStringStream.Create(Format('{%s}', [sRTF])); Try RichEdit.Lines.LoadFromStream(sText); Finally sText.Free; End; // Höhe des gesamten textes herausbekommen RichEdit.Perform(EM_POSFROMCHAR, Integer(@P), Length(RichEdit.Lines.text)); // Control anpassen RichEdit.Height := P.Y; End; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:01 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