I am trying to load images that have a listview
and Image list
. For some reason the files are loaded but do not show up in the listview. This is the code so far:
try {listView1.View = View.LargeIcon; ImageList1.ImageSize = New Size (32, 32); ListView1.LargeImageList = imageList1; DirectoryInfo directory = new DirectoryInfo (@ "C: \"); FileInfo [] Archives = directory.GetFiles ("* .jpg"); Foreign currency (fileinfo fileinfo in archives) {imageList1.Images.Add (Image.FromFile (fileinfo.FullName)); } ListView1.Update (); MessageBox.Show ("I found" + imageList1.Images.Count.ToString () + "Picture!"); } Hold {Messagebox.Show ("Something went wrong!"); }
Note that the message box is showing me the correct number of files, so I think some part of me is correct, what clue could be wrong?
Comments
Post a Comment