TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vimal balasubramanian
NA
13
9.5k
Adding Images in Listview using FolderBrowser
Mar 28 2014 6:02 AM
Hello friends,
I have tried to add more number of images with its 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);
}
}
Reply
Answers (
0
)
Database Printing
how to read text from image using c#