Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Einem Label eine Variable zuweisen?! (https://www.delphipraxis.net/99334-einem-label-eine-variable-zuweisen.html)

Balli 10. Sep 2007 22:13


Einem Label eine Variable zuweisen?!
 
Hey Leute!

Wie kann ich einem Label eine Variable zuweisen, also das das Label den Wert der Variable annimmt?
Danke schonmal im vorraus!

MfG,
Balli

pilic 10. Sep 2007 23:01

Re: Einem Label eine Variable zuweisen?!
 
Delphi-Quellcode:
Label1.Caption:=DeineVariable;
:roll:
Grundlagen

hoika 10. Sep 2007 23:14

Re: Einem Label eine Variable zuweisen?!
 
Hallo,

naaaaaaa ;)

kommt auf den Typ der Variablen an,,
Label.Caption ist vom Typ String

bei Var-Typ = Integer -> StrToInt
bei Var-Typ = Float(Double) -> StringToFloat oder Format


Heiko

Balli 12. Sep 2007 13:24

Re: Einem Label eine Variable zuweisen?!
 
das is ne Integer Variable, wo muss ich das StrToInt dann hinschreiben? :roll: :gruebel:

Matze 12. Sep 2007 13:30

Re: Einem Label eine Variable zuweisen?!
 
Zitat:

Zitat von Balli
und das muss ich jetz wo hinschreiben? :roll: :gruebel:

Schau dir die Einsteiger-Tutorials an, die du in pilics Links findest und arbeite diese durch, sonst machst du dir das leben nur unnötig schwer.

Delphi-Quellcode:
// Integer (Ganzzahl)
Label.Caption := IntToStr(Zahl);

// Floats (Kommazahlen)
Label.Caption := FloatToStr(Zahl);

Balli 12. Sep 2007 15:02

Re: Einem Label eine Variable zuweisen?!
 
Jo, Funktioniert, Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 21: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