How to implement the function of cleaning dynamically created Image? I create Image in a cycle. His name is:
ArrOfImage[i].Name :='ImgP'+IntToStr[i]; .... ( куча остальных свойств) ArrOfImage[i].Paren := TabSheepArrP[i]; // ну тут соответственно размещение на TabSheep который тоже создается программно. ( Все создается в 1 цикле => друг другу соответствует. It is necessary to clear all the Image with the same name.
I do this:
for fmMain.PageControl2.ControlCount-1 downto 0 do // Все это создается как вы поняли на 2-ом PageControl begin if Pos('ImgP',fmMain.PageControl2.Controls[i].Name) <> 0 then TImage(fmMain.PageControl2.Controls[i]).Picture := nil; end; It seems to be logical, and it should work, but for some reason fmMain.PageControl2.ControlCount = 1 and the Name of this control is the name of TabSheet , and as I understand it it does not see the Image .
Tell me how to solve this problem?
PS: If something helps: I try to get a link to Image using FindComponent , the function returns nil .
Dinamic,Paren, correct typos - Kromster