[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2004-11-18
10
Medium Priority
?
583 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:crsublette
  • 5
  • 3
  • 2
10 Comments
 
LVL 9

Expert Comment

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

0
 
LVL 18

Expert Comment

by:JR2003
ID: 12624945
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
 

Author Comment

by:crsublette
ID: 12631982
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:crsublette
ID: 12632340
I found the MSDN Library info at:

Add Method (ListItems Collection)

smallIcon Part
0
 

Author Comment

by:crsublette
ID: 12632370
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
 
LVL 18

Expert Comment

by:JR2003
ID: 12632516
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
 
LVL 9

Expert Comment

by:p_sie
ID: 12633294
That is right, I use it all the time!
0
 

Author Comment

by:crsublette
ID: 12633747
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
 
LVL 9

Accepted Solution

by:
p_sie earned 1200 total points
ID: 12634161
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
 

Author Comment

by:crsublette
ID: 12635051
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month20 days, 13 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question