Fórum FindComponent #356810
08/04/2008
0
(form1.findComponent(´editTeste´) as TEdit).text := ´edit teste´;
(form1.findComponent(´editTeste´) as TEdit).color := clBlue;
(form1.findComponent(´editTeste´) as TEdit).Top := 10;
(form1.findComponent(´editTeste´) as TEdit).Left := 20;
etc...
ou seja, tenho que ficar procurando o componente toda vez que for setar alguma propriedade. Teria alguma forma de buscar uma única vez e setar este componente, ou criar uma variável onde eu alteraria suas propriedades e assim o componente que procurei passaria a ter esses valores?
Rodrigoxcruz
Curtir tópico
+ 0Posts
08/04/2008
Rodc
var Ponteiro: TButton; begin Ponteiro := form1.findComponent(´editTeste´) as TEdit; Ponteiro.text := ´edit teste´; Ponteiro.color := clBlue; Ponteiro.Top := 10; Ponteiro.Left := 20; end;
Gostei + 0
08/04/2008
Rodc
var Ponteiro: TEdit; begin Ponteiro := form1.findComponent(´editTeste´) as TEdit; Ponteiro.text := ´edit teste´; Ponteiro.color := clBlue; Ponteiro.Top := 10; Ponteiro.Left := 20; end;
Gostei + 0
08/04/2008
Fknyght
with (form1.findComponent(´editTeste´) as TEdit) Do Begin text := ´edit teste´; color := clBlue; Top := 10; Left := 20; end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)