I have a FlowLayoutPanel that I fill with a custom UserControl
, and I have a TextBox
at the top of the form that I would like to use to filter the results. Each UserControl
stores it's properties, but I wasn't sure how to filter using those properties.
For example, say my UserControl
contains something like this:
// snip..
public string Text { get; set; }
public string Description { get; set; }
//snip..
How would I then go about taking the entry from the TextBox
and comparing it against both [usercontrol].Text
and [usercontrol].Description
? It has to be searched inside the text, not just from the beginning.
Once I've filtered the appropriate results, I would like those to be the only ones visible. Do I have to flush them all and rebuild it with only the applicable ones, or can I just remove the ones that don't match the filter?
I know this may be a very noob question, I just don't know where to start with it. Any ideas?