Fórum Mudar a cor do panel parent Delphi #594460
25/05/2018
0
procedure TTESTE_FRM.clique(Sender: TObject);
var
i : integer;
Controle : TControl;
begin
for i := 0 to ComponentCount-1 do
begin
if (TImage(Components[i]) = Sender) then
begin
resposta := TImage(Components[i]).Name;
Controle := (Sender as TControl).Parent;
if Controle is TPanel then
with Controle do
begin
Color := clGreen;
ShowMessage(Name);
end;
end;
end;
end;
Lucas Domiciano
Curtir tópico
+ 0Post mais votado
25/05/2018
procedure TTESTE_FRM.clique(Sender: TObject);
var
Controle: TControl;
begin
Controle := TControl(Sender).Parent;
if Controle is TPanel then
with TPanel(Controle) do
begin
Color := clGreen;
ShowMessage(Name);
end;
end;
note que para isso funcionar as propriedades ParentColor e ParentBackground do TPanel precisam estar False.
Emerson Nascimento
Gostei + 3
Mais Posts
25/05/2018
Lucas Domiciano
Gostei + 0
25/05/2018
Lucas Domiciano
Gostei + 1
Clique aqui para fazer login e interagir na Comunidade :)