Listview with Large icons

Zaphod

New Member
Hi all,

My application is using a treeview combined witj a listview and imagelists. Everything works fine except for one annoying problem. I have a pulldown menu that allows the user to decide the view method. The choices are : Small icons, Large icons and List.

When we select Large icons, my listview switches to the large icons view ok but it sometimes puts an horizontal scroll-bar in my listview. And we we move the bar to the rightmost position, the icons are moved slightly to the left and the scrollbar disappears.

I do not want this scrollbar to appear ever. What should I do ?
 
Hi,


Have you checked width-pixels and virtual-width-pixels of your frame? If not can you check it before and after your icon selection? It can lead to the mentioned effect.
We had similar problem (not with Tree ActiveX) and setting virtual-width-pixels equal to width-pixels could help.

Regards,
Gabor
 

Zaphod

New Member
Thanks Gabor for the info.

(BTW: I'm using ListView Activex Control - Version 6 (SP4) from Microsoft)

I checked the frame and the pixels are indentical for virtual and non-virtual dimensions. And even if they were not, the scrollbar would appear in the frame, not in the listview.

The scrollbar I'm taking about belongs to the listview object.

Note:

It is always the same listitems that generate the scrollbar. When the view mode is set to LIST and we are viewing the listitems in question, we can switch the view mode to LARGE ICONS and the listview object will switch to large icon without the scrollbar. The scrollbar appears only if we are already in LARGE ICON view mode and then we select the treeview node that generates the listitems in question.
 
Hi,

I made a small test program and I could make similar effect though the scroll-bar appeared in small icon mode.

I changed the Arrange attribute to 2 (IvwAutoTop) and the problem disappeared. Can you try that?

Note: I used ListView Version 5 SP2.


Best regards,
Gabor
 

Zaphod

New Member
Hi all

The first thing I do with my ListView is set the BorderStyle to 0 and Arrange to 2.

I put messages in my code after each ListItems:Add() statement to show the value of ListItem:Left which is supposed to be the number of units from the left edge of the container. The first icon is 16 units from the left, and then the next icon is 125 etc.

But I noticed that the rightmost icon on the first row which triggers the scrollbar says 16 again which means it should actually display as the first icon on the second row. That is weird. I dont get it.
 

Zaphod

New Member
I fixed my problem buy setting my ListView:View method to 2 (List) before populating the listimtems. And then I change the view method to the user selection.

It works but I should not have to do this.

It must be another Microsoft undocumented feature.

Thanks for your help.
 

Zaphod

New Member
I thought I fixed the problem but I didn't. It just seemed that way. So I think I'll just give up and let the ListView do it's own thing.

Thanks all.

:blue:
 
Top