Very EASYquestion, which control to use?

I need the same funcionality as a standard ListBox provides, but multiple columns per line.
I mean a listitem consists of more corresponding datas as date, data, etc. And I need a header for all columns.

Which control to use?
cosieAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
deightonConnect With a Mentor Commented:
listview, bit tricky to use at first, here is an example

add reference to MS windows common controls, add a listview to your form then see this code

Private Sub Form_Load()

With ListView1

    Dim itmX As ListItem

    .View = lvwReport
    .ColumnHeaders.Add , "a", "column 1"
    .ColumnHeaders.Add , "b", "column 2"
    .ColumnHeaders.Add , "c", "column 3"
   
    .HideColumnHeaders = False
   
    Set itmX = .ListItems.Add(, "r", "item 1")
    itmX.SubItems(1) = "item2"
    itmX.SubItems(2) = "item3"
   
   
End With
   

End Sub
0
 
RobDillonCommented:
I would suggest using a databound grid control if your data is in a database. If you are going to populate the grid manually you may want to use an msFlexgrid control (this can be a little complicated to use). The listview control affords the opportunity to include images in your grid as well as checkboxes or drop-down lists. Have a look at each of these and see what's best for you.
0
 
cosieAuthor Commented:
I dont't need db access, nor images, or dropdown, just strings. I need the most simple component to code.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
pierrecampeCommented:
the most simple component is the MSFlexgrid (in my opinion)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I suggest the ListView control:
check the "Microsoft Windows Common Controls version x.0" in project components, and you will have a bunch of controls, where the listview should do the trick:
* view -> Report to get the headers
You can configure the headers at design time or at runtime...

CHeers



0
 
cosieAuthor Commented:
Hi deighton,

only one thing to know, how to clear the listview?
0
 
cosieAuthor Commented:
Hi deighton,

only one thing to know, how to clear the listview?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Listview1.Listitems.Clear

Cheers
0
 
cosieAuthor Commented:
Thanx to all!
0
 
AhmadKhanCommented:
There are more options if u want.
0
All Courses

From novice to tech pro — start learning today.