We help IT Professionals succeed at work.

how can i delete one control based on its tagstring ?

dolphin King
dolphin King asked
on
209 Views
Last Modified: 2018-03-27
I had this question after viewing Tvertscrollbox like a whatsapp layout delete messages.

this answer shows how to delete all CR := TCalloutRectangle inside Vertscrollbox

i wanted to delete only one TCalloutRectangle based on its tag string how can i do that ?
Comment
Watch Question

Software architect
CERTIFIED EXPERT
Top Expert 2012
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
why when i delete some times app crashes ?
Sinisa VukSoftware architect
CERTIFIED EXPERT
Top Expert 2012

Commented:
Is it on windows or android? Can you catch exception (try .. except ... showmessage .. end)?

Author

Commented:
it is on android even try block did not catch any exception

Author

Commented:
i believe this was fmx problem it self
Geert GOracle dba
CERTIFIED EXPERT
Top Expert 2009

Commented:
when you delete something always use a reverse loop ...

  for i := count-1 downto 0 do 
    // delete stuff

Open in new window


otherwise the counter goes beyond the end point