Can I show the ListView small icons in a single column?

I am going crazing. The ListView does everything i want it to do except one thing. If room exists to place another column, the control will insert another column, and this is not going to work for me.

The ListView control is in SmallIcon view with Checkboxes enabled. I also disabled the drag and drop.

I want a *single column* list of items where each item has a checkbox and an icon.

So close I can smell the goat cheese, but not just yet. I messed with the ColumnHeaders by setting it to 1 column and making the column really wide, but this didn't work.

Can I have a ListView in small icon view that shows the item list in only a single column? If not, is there a simple workaround? I write *simple* because I have no problem coding complex workarounds.
crsubletteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

p_sieCommented:
Instead of smalliconview use the report-view, add 1 column and add items with the smallicon, the icon you want.

0
JR2003Commented:
Try this, just add a listview control and a command button to your form:

Private Sub Form_Load()
    Dim i As Long
    With ListView1
        .ColumnHeaders.Add
        .HideColumnHeaders = True
        .View = lvwSmallIcon
        .Checkboxes = True
        With .ListItems
            For i = 1 To 50
                .Add , , "Item " & i
            Next i
        End With
    End With
End Sub

Private Sub Command1_Click()
    With ListView1
        If .View = lvwReport Then
            .View = lvwSmallIcon
        Else
            .View = lvwReport
        End If
    End With
End Sub
0
crsubletteAuthor Commented:
Man, I swear. Icons should not be shown in report-view.

The MSDN Library says this about the smallIcon property:
"Optional. An integer that sets the icon to be displayed from an ImageList control, when the ListView control is set to SmallIcon view."

After analyzing the above statement, if report-view can display icons, is this a bug?

I changed the view to report-view, but I swear this didn't work before I set the view to small-icon.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

crsubletteAuthor Commented:
I found the MSDN Library info at:

Add Method (ListItems Collection)

smallIcon Part
0
crsubletteAuthor Commented:
Ok. The TreeView control has met my requirements.

I still wonder, why I am still able to show icons in Report-View for the ListView control?
0
JR2003Commented:
It's not a bug, you can show Icons in ReportView you can also show icons on each subItem on report view if you want.
0
p_sieCommented:
That is right, I use it all the time!
0
crsubletteAuthor Commented:
I understand it works, but I don't think this action complements what the MSDN Library says about adding an icon to a subitem. What does "when the ListView control is set to SmallIcon view" mean to you?
0
p_sieCommented:
I read this in the MSDN

In the List, SmallIcon, and Report views, you can use a small icon to represent the ListItem object.

where the msdn page has the title 'Using the ListView Control'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
crsubletteAuthor Commented:
Aahhh....I got yeah.

The statement sure did mislead me. What I got from it is, "When the ListView control is set to SmallIcon view, the integer will set the icon to be displayed." It shouldn't even mention SmallIcon view because the info you point out says "You can arrange items into columns with or without column headings as well as display accompanying icons and text." Sheesh.

Thanks p_sie!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.