But wait a minute![]()
![]()
![]()
Instead of manually adding Label1, Label2, Label3..., it’s better to use dynamic components.
That way you don’t need to hard-code each label name — you just keep all texts in a list, then dynamically create labels in a loop.
When the user types a search term, you just loop through the list of dynamic labels and check:
- If label text contains the search word → change its
TextColororBackgroundColorto highlight. - Else → reset it to normal.
This approach is much cleaner and scalable compared to managing fixed Label1, Label2, Label3.
You can learn more from here