What I want to do is a drop down list (comboBox) that the user can see only selected files. For example, if user selects a Word Documents from a comboBox, on the explorer will be only visible a doc files.
I have done a FileFilter class:
public class FileFilter
{
public FileFilter(string name, string filter)
{
// Store values
Name = name;
Filter = filter;
}
public string Name { get; private set; }
public string Filter { get; private set; }
}
and on the Form1 load I specified the filter available:
Collection<FileFilter> filters = new Collection<FileFilter>();
filters.Add(new FileFilter("Word Documents", "*.doc"));
filters.Add(new FileFilter("Pdf Documents", "*.pdf"));
Now I would like to know how can I fill the comboBox with the Collection of FileFilter objects (with "Word Documents" and "Pdf Documents", and then use the filter on Directory.GetFiles();
If I do on the form_Load:
comboBox1.Items.Add(filter);
it doesn`t show what I want in the comboBox.