On a treeview after the select event, I populate a listview with images.
I want to custom format these images and place a black color border around each image.
private void TreeView1_Select(object sender, EventArgs e) {
if (folder != null && System.IO.Directory.Exists(folder)) {
DirectoryInfo dir = new DirectoryInfo(@folder);
foreach (FileInfo file in dir.GetFiles()) {
try {
imageList.Images.Add(Image.FromFile(file.FullName));
} catch {
Console.WriteLine("This is not an image file");
}
}
for (int j = 0; j < imageList.Images.Count; j++) {
this.ListView1.Items.Add("Item" + j);
this.ListView1.Items[j].ImageIndex = j;
}
this.ListView1.View = View.LargeIcon;
this.ListView1.LargeImageList = imageList;
this.ListView1.DrawItem +=
new DrawListViewItemEventHandler(ListView1_DrawItem);
}
}
private void ListView1_DrawItem(object sender, DrawListViewItemEventArgs e)
{
}