Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Try to free a control inside a panel
Thu, Nov 21 2013 5:52 AMPermanent Link

Franck - Midi pyrénées - France

Esteves Ducilia

Avatar

Hello there,

the free method gives an error when I try to free a control inside a panel.   
However the hide method or name work correctly.
see screenshot attached

Any idea ? many thanks

       For i:= panelSousMenu2.ControlCount-1 DownTo 0 Do
            begin
               if (panelSousMenu2.Controls[i] is TEdit) then
                    showMessage(TEdit(panelSousMenu2.Controls[i]).name) ;   <-- works fine
                    TEdit(panelSousMenu2.Controls[i]).free ;   <--- error
                    //panelSousMenu2.Controls[i].hide ;   <-- works fine



Attachments: free.gif
Thu, Nov 21 2013 12:48 PMPermanent Link

Walter Matte

Tactical Business Corporation

Thu, Nov 21 2013 12:50 PMPermanent Link

Uli Becker

Fri, Nov 22 2013 11:13 AMPermanent Link

Franck - Midi pyrénées - France

Esteves Ducilia

Avatar

With your example , I do this and that works . Perfect, thank you .

procedure TFormMenuGeneral.panelFree(Sender: TPanel);
begin
  Sender.free ;
end ;
Image