Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# .net Windows Forms Listview with image in Detail View

I want something like this develop using C# .net for Windows Forms. (ListView Details View). Putting a Image is the problem.

enter image description here

Help me ..!!

Thank You

Yohan

like image 942
yohan.jayarathna Avatar asked Mar 10 '11 04:03

yohan.jayarathna


2 Answers

You may want to take a look at this Code Project entry.

Extended ListView

like image 70
Plebsori Avatar answered Nov 10 '22 10:11

Plebsori


Hope that the following code can help you out. using C#

ImageList il = new ImageList();
il.Images.Add("test1", Image.FromFile(@"c:\Documents\SharpDevelop Projects\learning2\learning2\Koala.jpg"));

listView1.View = View.LargeIcon;
listView1.LargeImageList = il;
listView1.Items.Add("test");

for(int i = 0; i < il.Images.Count; i++)
{
    ListViewItem lvi = new ListViewItem();
    lvi.ImageIndex = i;
    lvi.Text="koala 1";
    listView1.Items.Add(lvi);
}

Running this kind of code can get you the image and the text in a listview. For further more details, refer to this post

like image 37
Saravanan Avatar answered Nov 10 '22 10:11

Saravanan