How to reclaim image real estate in ListView?

  • Thread starter Thread starter Serge Wautier
  • Start date Start date
S

Serge Wautier

Hi All,

Env.: VS 2008, .NET 2.0, WinForms

I have a listview in Tile mode. Some items have an associated image. Some
don't.

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

list.Items.Clear();FillList();list.LargeImageList= (none of the items has
image) ? null : MyImageList;But it doesn't work: The empty space is still
there. I also try to repaint the control, to no avail.

What can I do?

TIA.
 
You can try using a 1x1 imagelist

---------
- G Himangi, LogicNP Software http://www.ssware.com
Shell MegaPack: GUI Controls For Drop-In Windows Explorer like File/Folder
Browsing Functionality (.Net & ActiveX Editions).
EZNamespaceExtensions: Develop namespace extensions rapidly in .Net and
MFC/ATL/C++
EZShellExtensions: Develop all shell extensions,explorer bars and BHOs
rapidly in .Net & MFC/ATL/C++
 
G, Thanks for the suggestion.

Serge

G Himangi said:
You can try using a 1x1 imagelist

---------
- G Himangi, LogicNP Software http://www.ssware.com
Shell MegaPack: GUI Controls For Drop-In Windows Explorer like File/Folder
Browsing Functionality (.Net & ActiveX Editions).
EZNamespaceExtensions: Develop namespace extensions rapidly in .Net and
MFC/ATL/C++
EZShellExtensions: Develop all shell extensions,explorer bars and BHOs
rapidly in .Net & MFC/ATL/C++
 
Back
Top