Is it possible to move a control to another Frame? lazarus / 31-LCL ---------------------------------------------------------------------- Edson · 2015-05-13 15:48 I have been searching but no success. What I have is two Frames: Frame1 have one StringGrid with a lot of data. I want to move this StringGrid dynamically to Frame2, including the data, without need to copy the content or move to disk first  (several MB).  Later Frame1 will be destroyed, thats why I need to translate the StringGrid. Is it possible to do this? For all I know, it's not enough to change the Parent of the StringGrid. Thanks ---------------------------------------------------------------------- howardpc · 2015-05-13 16:24 Changing the Parent of a stringgrid from one frame to another successfully moves display of the stringgrid to the new frame here (Laz 1.4.0, win32). However, you're planning on destroying the original frame, which remains the owner of the stringgrid, so at that point the grid will also be destroyed. Presumably you could dynamically create the grid, and so make it owned by some other instance than the frame you are destroying. But if you use the RAD designer to create the grid by dropping it on a frame from the component palette, its owner will be set to the original frame. ---------------------------------------------------------------------- Edson · 2015-05-13 21:28 Thanks for the answer @howardpc. In fact, your suggestion is what I have thought. I've analyzed that I need the StringGrid in Frame2, so I need to create it on Frame2, then I just need to show in Frame1, changing the Parent there. then no problem with destroying. ---------------------------------------------------------------------- sky_khan · 2015-05-13 23:43 Its also possible changing the owner of component this way Code: [Select]Frame1.RemoveComponent(Grid1); Frame2.InsertComponent(Grid1); ---------------------------------------------------------------------- Edson · 2015-05-14 16:46 I didn't know you could do that. I guess it leaves an orphan Grid, for one instant. ---------------------------------------------------------------------- howardpc · 2015-05-14 18:29 No, nothing is orphaned. It simply makes a different component responsible for freeing Grid1.