Okay... I have and example project.
I was originally using TSpeedButton to dynamically create a button array.However, there was no Hover Font Color.
LAINZ suggested using the TCButton, I love it! So customize-able!
However, the SpeedButton had the "Active" state that just automatically worked.
BUT, TCButton doesn't have that. The only property close to that is the "DOWN" state
And I can trigger that when the button is click. That works
However, if you click on multiple buttons they "go down" but previous ones that I click don't go back up.
So, the only way I know in theory is to loop through all the dynamically created buttons and set DOWN:=FALSE to clear everything.
And then only one button appears down.
Got it so far?
THE PROBLEM....When i loop through the array to try an set all the buttons DOWN property to FALSE
I get errors saying the identifier is not known (or similar)
And what I don't understand is that
Item.Caption:='Button' + IntToStr(i); - works fine - "Caption" is exposed to the array
BUT
Item.Down:=false; DOESN'T WORK. - Error: identifier idents no member "Down"Why?
CODE JUST FOR TRYING TO RESET DOWN PROPERTY
procedure TForm1.Button2Click(Sender: TObject);
// LOOP THROUGH BUTTONS - CHANGE DOWN TO FALSE
var
i: Integer;
Item: TControl;
begin
for i := (Panel1.ControlCount - 1) downto 0 do
begin
Item := Panel1.controls[i];
Item.Caption:='Button' + IntToStr(i);
Item.Down:=false; - //DON'T WORK
//TBCButton.Down:=false; - DON'T WORK
//TBCButton(i).Down:=false; - DON'T WORK
end;
end;
All other code works.
BUT if you want a project to see and try for yourself
Download from here:
https://www.pixelink.media/downloads/BtnArrays.zipThanks in advance