Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Adding Icons to items during runtime
posted

Hi

 

I want to add icons to my items during runtime. I set the imagelists (Large- and small)of the listview  in the init-function of my form.

When I created new items to and I do assign the image for it.

In the LV now online an empty space appears where the icon normally is located.

 

 

Whats wrong?

 

Kindly regards

Chris

Parents
No Data
Reply
  • 69832
    Offline posted

    It is difficult to speculate about what the problem might be without having a look at the code. You state that an "empty space appears", which could indicate that the image is corrupt or completely transparent.

    The following code sample demonstrates the correct approach; you could possibly compare this to your code and determine what is going wrong:

    this.listView.View = UltraListViewStyle.Details;
    this.listView.ViewSettingsDetails.ImageList = this.imageList1;

    UltraListViewItem item = this.listView.Items.Add( null, "Test" );

    // Assign the first member of the ImageList's Images collection
    item.Appearance.Image = 0;

    If this doesn't help, you might want to post a small code sample that demonstrates the problem, or report the issue via the web support form so that you can provide a test project that demonstrates the problem.

Children