Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Label umfärben mit ColorDialog (https://www.delphipraxis.net/8027-label-umfaerben-mit-colordialog.html)

citybreaker 27. Aug 2003 10:27


Label umfärben mit ColorDialog
 
Hallo!

Ich folgendes Problem, ich will einen
Label mit einen ColorDialog umfärben.

Ich 2 verschiedene sachen versucht.

1.
Code:
if ColorDialog.Execute then
Label1.Color := ColorDialog.Color;
2.
Code:
if ColorDialog.Execute then
Label1.Brush.Color := ColorDialog.Color;
Leider klappt keine der beiden möglichkeiten.
Gibt es noch eine andere Lösung dafür?

sakura 27. Aug 2003 10:30

Re: Label umfärben mit ColorDialog
 
Willst Du die Hintergrundfarbe des Labels ändern? Dann ist das schon korrekt. Du musst nur sicherstellen, daß das Label nicht Transparent (gleichnamige Eigenschaft) ist.

Delphi-Quellcode:
  if ColorDialog1.Execute then
    Label1.Color := ColorDialog1.Color;
Willst Du die Schriftfarbe ändern? Dann ist folgende die Lösung.

Delphi-Quellcode:
  if ColorDialog1.Execute then
    Label1.Font.Color := ColorDialog1.Color;
...:cat:...

citybreaker 27. Aug 2003 10:36

Re: Label umfärben mit ColorDialog
 
Jep, will die Hintergrundfarbe ändern.
Der Label ist nicht Transperrent und
es geht trotzdem nicht. Kann es daran
liegen, dass der Label auf einen GroupBox
ist?

neolithos 27. Aug 2003 10:43

Re: Label umfärben mit ColorDialog
 
Schal mal nach der Eigenschaft ParentBackground des Label's sollte false sein

citybreaker 27. Aug 2003 10:46

Re: Label umfärben mit ColorDialog
 
Ok jetzt klappts lag an was anderem.
Parenbackground gibts bei Labels gar nicht,
steht zumindest net bei mit im ObjekteInspector.

sakura 27. Aug 2003 11:35

Re: Label umfärben mit ColorDialog
 
An was lag es denn?

...:cat:...

citybreaker 27. Aug 2003 11:38

Re: Label umfärben mit ColorDialog
 
Ich hab Showhint auf false
gestellt und dann ging es,
ich nehme mal an das es daran
lag. :D


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:12 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 by Thomas Breitkreuz