Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

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?
0
cosie
Asked:
cosie
1 Solution
 
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
 
pierrecampeCommented:
the most simple component is the MSFlexgrid (in my opinion)
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
deightonCommented:
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
 
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
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.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now