Pictures on listview

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

 

Missing something?

Dim j As New ListViewItem
j.Name = 1
j.Text = 1
j.ImageSource = “/icon.png”

j.SubItems.Add(“some text”)

 

First my code works.

 

Now with the last update my code doesn’t work.

I can see the item, but not the image

You change something in the update.

 

Thanks

 

  • You must to post comments
0
0

I tried this code:

private void Window1_Load(object sender, EventArgs e)
{
var j = new ListViewItem();
j.Name = “1”;
j.Text = “1”;
j.ImageSource = “/icon.png”;
j.SubItems.Add(“some text”);

this.listView1.Items.Add(j);

j = new ListViewItem();
j.Name = “1”;
j.Text = “1”;
j.ImageSource = “/icon.png”;
j.SubItems.Add(“some text”);

this.listView2.Items.Add(j);

j = new ListViewItem();
j.Name = “1”;
j.Text = “1”;
j.ImageSource = “/icon.png”;
j.SubItems.Add(“some text”);

this.listView3.Items.Add(j);

j = new ListViewItem();
j.Name = “1”;
j.Text = “1”;
j.ImageSource = “/icon.png”;
j.SubItems.Add(“some text”);

this.listView4.Items.Add(j);
}

 

 

It works well. Can you please verify that /icon.png is present in the root of the project? Also do you see a broken image or the item doesn’t show at all? Can you provide a small test case?

 

 

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json