Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Absatz im Label (https://www.delphipraxis.net/24749-absatz-im-label.html)

sui 25. Jun 2004 14:40


Absatz im Label
 
Moin,

wie kann ich eigentlich Text im Label mit Absätzen ausgeben?

Bei mir erscheint das alles in einer Reihe:

Code:
procedure TForm1.Timer1Timer(Sender: TObject);
var
  Memory: TMemoryStatus;
begin
 Memory.dwLength := Sizeof (Memory);


  GlobalMemoryStatus(Memory);
   label1.Caption := ('Speicher: ' +
    IntToStr(Memory.dwTotalPhys div 1048576) + ' MByte' + ' Freier Speicher: ' +
    IntToStr(Memory.dwAvailPhys div 1048576) + ' MByte');

end;
Gibt es nicht irgendwas wie das
im HTML? :gruebel:

notam 25. Jun 2004 14:47

Re: Absatz im Label
 
Delphi-Quellcode:
label1.caption := 'Zeile1' + #13#10 + 'Zeile2'; [...]

Gruß Manuel

devnull 25. Jun 2004 14:50

Re: Absatz im Label
 
Oder:
Delphi-Quellcode:
label1.caption := 'Zeile1' + char($0D) + 'Zeile2';

Interceptor 25. Jun 2004 14:51

Re: Absatz im Label
 
jau, die gibt es: + #13#10 +

In deinem Falle dann:
Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
var
  Memory: TMemoryStatus;
begin
 Memory.dwLength := Sizeof (Memory);


  GlobalMemoryStatus(Memory);
   label1.Caption := ('Speicher: ' +
    IntToStr(Memory.dwTotalPhys div 1048576) + ' MByte' + #13#10 + 'Freier Speicher: '+
    IntToStr(Memory.dwAvailPhys div 1048576) + ' MByte');
end;
Mfg, Interceptor

Edit: Mist, zu spät :wink:


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:40 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz