Hello friends,
I have tried to add more number of images with path into Listview using FolderBrowserDialog,I used below code, But I'm getting error. Can any one tell how to resolve this problem.
private void btnBrows_Click(object sender, EventArgs e)
{
FolderBrowserDialog browsefolder = new FolderBrowserDialog();
if (browsefolder.ShowDialog() == DialogResult.OK)
{
listviewbin.Items.Clear();
string[] myfiles = Directory.GetFiles(browsefolder.SelectedPath);
foreach (string file in myfiles)
{
int i = 0;
ListViewItem myitem = new ListViewItem(file, i);
imageList1 = new ImageList();
imageList1.Images.Add(Image.FromFile(file));
i++;
if (i == imageList1.Images.Count - 1)
{
i = 0;
}
listviewbin.Items.Add(myitem);
}
}
Using folder browser dialogue,need to add image
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sivaraman DhamodaranRank #40 · 34.5K reputationPosted Mar 28, 2014, 1:47 AM EDT
Link
Abhay ShankerRank #375 · 6.7K reputationPosted Mar 28, 2014, 2:12 AM EDT