![]() |
Re: TLabel + taRightJustify = katastrophe?
Delphi-Quellcode:
die erste Ausgabe ergibt "Left: 300 Width: 65". "65" ist also die Default-Breite eines (leeren) Labels. Wenn Du jetzt l.Caption den neuen Text zuweist, erhältst Du "Left: 316 Width: 49". Der Text ist als kürzer als die bisherige Breite, und daher wird (bei rechtsbündiger Ausrichtung) der Anfang des Labels nach rechts verschoben.
procedure TForm1.FormCreate(Sender: TObject);
begin l := tLabel.Create(self); l.Left := 300; l.Alignment := taRightJustify; l.Parent := Self; l.Top := 3; Showmessage('Left: ' + IntToStr(l.Left) + ' Width: ' + IntToStr(l.Width)); l.Caption := 'Hallo Welt'; Showmessage('Left: ' + IntToStr(l.Left) + ' Width: ' + IntToStr(l.Width)); end; jkr |
Re: TLabel + taRightJustify = katastrophe?
Zitat:
Zitat:
Ich hatte es schon mal mit .Width := 0 versucht, aber da hatte es auch nicht hingehauen, aber jetzt funzts :) Danke! MfG xZise |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:27 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