Greetings!
I am really new to C#, and fairly new to programming itself aswell. Although i've got to know C# quite a bit now, but mostly on the console program side of it. Now i'd like to get introduced to the windows environment better. I made myself a little picture / photo album browser, where i choose a file with OpenFileDialog and it is shown in a picturebox - Ok, this works like a charm. But it would be so much easier to browse pictures as a bunch, not by opening them one at a time.
So my problem is that i would love to do this so that i could choose a folder (with FolderBrowserDialog), and then i could browse through the images in that chosen folder, using puttons like previous image and next image. How is this done? Anykind of help / hint for a solution is greatly appreciated.
Thanks in advance!
skinex
Loading
ChongoPosted Apr 14, 2008, 9:12 AM
I think you will need the System.IO;
DirectoryInfo dir = new DirectoryInfo(@"C:\dir\images");
FileInfo[] jpgfiles = dir.GetFiles("*.jpg");
int position = jpgfiles.Length;
foreach( FileInfo f in jpgfiles)
{
_name_list.Add(position, f.Name);
position--;
}
then you can use buttons to browse through the list.