Re:Very weird problem with FindComponent.
Hi !
FindComponent is a method of TComponent, not a plain function. So, if you use it outside a TForm
method, you must specify on what component to invoke it:
e.g.: SomeEdit:=TEdit(Form1.FindComponent('Edit1'));
--
Bjoerge
<<Ad van de Laar skrev i meldingen <37a59eba.2561...@news.xs4all.nl>...
Hi,
I want to use this line in a procedure:
Edit := TEdit(FindComponent('Edit' + IntToStr(i + 1)));
The Classes unit is mentioned by Uses. The line above works if I put
it in the TForm1.FormCreate procedure. The compiler gives no error.
But if I put it in the procedure were I need it(same unit), the
compiler gives 'Undeclared indentifier : FindComponent'. If I put the
mouse-cursor on the FindComponent, nothing happens --> normally you
see the unit FindComponent belongs to and the source-line.
I also use TMemoryStream in this same procedure and it uses also
Classes. But the compiler doesn't give an error with the MemoryStream.
How is this possible?
Many thanks for your help.
Regards,
Ad van de Laar>>