Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to reclaim image real estate in ListView?
    text
    copied!<p>Env.: VS 2008, .NET 2.0, WinForms</p> <p>I have a listview in Tile mode. Some items have an associated image. Some don't.</p> <p>The contents (listview items) is often renewed when user clicks some controls. When this happens, it sometimes appears that none of the new items have images. In that case, I would like to get rid of the empty space on the left of items reserved for images. I tried the following pseudo-code to temporarily get rid of the image list</p> <pre><code>list.Items.Clear(); FillList(); list.LargeImageList= (none of the items has image) ? null : MyImageList; </code></pre> <p>But it doesn't work: The empty space is still there. I also try to repaint the control, to no avail.</p> <p><a href="http://apptranslator.com/_so/so_list1.jpg" rel="nofollow noreferrer">alt text http://apptranslator.com/_so/so_list1.jpg</a> <a href="http://apptranslator.com/_so/so_list2.jpg" rel="nofollow noreferrer">alt text http://apptranslator.com/_so/so_list2.jpg</a> <a href="http://apptranslator.com/_so/so_list3.jpg" rel="nofollow noreferrer">alt text http://apptranslator.com/_so/so_list3.jpg</a></p> <p>Left: list with images.</p> <p>Middle: List without images. Space for images is visible.</p> <p>Right: How I would like it to be when there's no images.</p> <p>EDIT: I also made this test: Don't assign the image list in the designer. If the first display doesn't contain any images, then I get the expected result. I then click to display images (I get them). I click again to come back to a no images selection: the image space doesn't disappear.</p> <p>Also, Hath, no I don't use small images or state images. Only large images.</p> <p>What can I do? TIA.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload