12

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

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
yohan.jayarathna
  • 3,423
  • 13
  • 56
  • 74
  • 1
    There are a ton of articles and documentation out there with samples. A quick google search should show you [several](http://msdn.microsoft.com/en-us/library/aa983754%28v=vs.71%29.aspx) [good](http://programmerslog.wordpress.com/2008/07/18/using-listview-control/) ones... or even similar [StackOverflow](http://stackoverflow.com/questions/3388025/how-can-i-add-image-to-listview-when-i-set-it-to-details) questions and answers. – John Arlen Mar 10 '11 at 05:05

2 Answers2

19

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

HadleyHope
  • 1,173
  • 1
  • 10
  • 19
Saravanan
  • 7,637
  • 5
  • 41
  • 72
2

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

Extended ListView

Plebsori
  • 1,075
  • 9
  • 23