How to reclaim image real estate in ListView?

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.
 
G

G Himangi

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++
 
S

Serge Wautier

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++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top