![]() |
Alle Buttons auf Panel ansprechen
Ich wollte alle Buttons auf einem Panel ansprechen.
Also habe ich es so versucht:
Delphi-Quellcode:
Leider funktioniert das so nicht, weil er nicht in die Schleife geht. Und ich bin mir sicher, dass das Panel Komponenten hat!
for i := 0 to xiBg.ComponentCount - 1 do begin
if xiBg.Components[i] is TXiButton then begin with (xiBg.Components[i] as TXiButton) do begin ColorBorder := StringToColor(Skin.ReadString('Buttons', 'Border', '$00B35900')); ColorDark := StringToColor(Skin.ReadString('Buttons', 'Dark', '$00FFA851')); ColorFace := StringToColor(Skin.ReadString('Buttons', 'Face', '$00FF953E')); ColorFocusRect := StringToColor(Skin.ReadString('Buttons', 'FocusRect', '$00FFA953')); ColorGrad := StringToColor(Skin.ReadString('Buttons', 'Grad', '$00FFB66C')); ColorLight := StringToColor(Skin.ReadString('Buttons', 'Light', '$00FF953E')); ColorText := StringToColor(Skin.ReadString('Buttons', 'Text', '$00000000')); end; end; |
Re: Alle Buttons auf Panel ansprechen
Gehe doch am besten alle Componenten des Formulars durch (und nicht die des Panels) und dann prüfe, ob als Parent dein Panel gesetzt ist...
(xiBG ist doch ein Panel, oder?) |
Re: Alle Buttons auf Panel ansprechen
xiBg : TXiPanel
ja ist es... Okay dann versuchs ich mal so. (Das Formular ist übrigends ein Panel, also ist die Parentabfrage nicht nötig.) [edit]So funktionierts ?! Seltsam... Gibts dafür einen Grund?[/edit] |
Re: Alle Buttons auf Panel ansprechen
Zitat:
- MyCtrl.Components[] listet alle Komponenten auf, deren Owner MyCtrl ist. - MyCtrl.Controls[] listet alle Controls auf, deren Parent MyCtrl ist. Wenn du nun eine Komponente auf das Formular setzt, dann ist der Owner das Formular. Der Parent jedoch das Control, auf dem du die Komponente abgelegt hast. Du musst also in deinem obigen Beispiel Panel.Controls[] durchlaufen und nicht Panel.Components[]. |
Re: Alle Buttons auf Panel ansprechen
Achso! Danke... das ist logisch ;)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:53 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