ObjectListView show icons

前端 未结 1 884
误落风尘
误落风尘 2021-01-06 10:06

Trying to put icons in ObjectListview, here\'s my piece of code where icon should have been put:

objectListView1.SmallImageList = imageList1;

        delete         


        
相关标签:
1条回答
  • 2021-01-06 10:44

    In order for images to appear next to the text in a column, you must:

    1. Connect the ObjectListView to an ImageList (using the SmallImageList property);
    2. Install an ImageGetter delegate for the column that must show the images;
    3. Make sure that there are actually images in the ImageList.

    With this done, images will appear (I just tested this).

    There is one catch, though. From your question, I suspect that the "Delete" column may not be the first column in the ObjectListView. The above steps only allow you to show an image in the very first column. For subsequent columns, you will have to set the ShowImagesOnSubItems property to True. Could that be it?

    0 讨论(0)
提交回复
热议问题