I have a folder which contains all images.I want the names of the images to be displayed in a combobox and when i click on a image the image should be displayed in a picturebox(in C#.net).plzz help me in the code
navimir 0 Newbie Poster
Recommended Answers
Jump to PostMore detailed version
String[] paths; private void Form1_Load(object sender, EventArgs e) { DirectoryInfo di = new DirectoryInfo(@"D:\Project\Pictures\"); paths = new String[di.GetFiles().Count()]; MessageBox.Show(paths.Length + ""); int i = 0; foreach (FileInfo fi in di.GetFiles()) { comboBox1.Items.Add(fi.Name); } foreach (FileInfo fi in di.GetFiles()) { paths[i] = fi.FullName; i++; } …
Jump to PostYou need an extra using statement:
using System.IO;
All 5 Replies
abelLazm 183 Postaholic
abelLazm 183 Postaholic
navimir 0 Newbie Poster
navimir 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.