Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 05.01.10 08:32 
Moin Forum,

ich kann bei einem zur Laufzeit erzeugten TPanel die Farbe nicht ändern.
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
var
  Form4        :TForm4;
  Station1     :TPanel;

implementation

{$R *.dfm}





procedure TForm4.FormCreate(Sender: TObject);
begin

  Station1 := TPanel.Create(Form4);
  with Station1 do begin
    Name         := 'Irgendwas';
    Parent       := Form4;
    Top          := 54;
    Left         := 86;
    Height       := 100;
    Width        := 45;
  end;

end;






procedure TForm4.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Station1.Free;
end;





procedure TForm4.Button1Click(Sender: TObject);
begin
  Station1.Color := clLime;
  Form4.Color    := clYellow;
end;


procedure TForm4.Button2Click(Sender: TObject);
begin
  Station1.Color := clRed;
end;






end.


Wenn ich Button1 drücke, ändert sich die Farbe vom Formular UND meinem Panel.
Wenn ich Button2 drücke, sollte mein Panel sich ja eigentlich rot färben, es passiert aber nichts.

Was habe ich denn hier übersehen? Sehe ich den Wald vor lauter Bäumen nicht?

Gruß Oliver

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Di 05.01.10 08:47 
Hi =)

Das klingt nach ParentColor. Setz' das mal beim Panel auf false, klappt es dann?

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 05.01.10 08:47 
also bei mir funktioniert der Code.

_________________
mfg. Joel
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 05.01.10 08:49 
Habe so etwas vermutet, danke für den Hinweis.
Geht leider dennoch nicht.

Gibt es bei einem neu dem Projekt hinzugefügten Formular etwas zu beachten?
(Ich verwende D2007 prof.)

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 05.01.10 08:54 
- Nachträglich durch die Entwickler-Ecke gelöscht -
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 05.01.10 09:02 
ParentBackground := false löst das Problem.

Ich verwende aber eigentlich kein XP-Manifest. Wo stellt man das denn ein?

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 05.01.10 09:07 
- Nachträglich durch die Entwickler-Ecke gelöscht -
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 05.01.10 09:13 
Dennoch seltsam.
Steht in keiner Uses-Klausel drin, und die Komponente habe ich auch nicht auf dem Formular...

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...