Solved

Very EASYquestion, which control to use?

Posted on 2002-07-04
10
132 Views
Last Modified: 2010-05-02
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
Comment
Question by:cosie
10 Comments
 

Expert Comment

by:RobDillon
Comment Utility
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
 

Author Comment

by:cosie
Comment Utility
I dont't need db access, nor images, or dropdown, just strings. I need the most simple component to code.
0
 
LVL 6

Expert Comment

by:pierrecampe
Comment Utility
the most simple component is the MSFlexgrid (in my opinion)
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
 
LVL 18

Accepted Solution

by:
deighton earned 100 total points
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:cosie
Comment Utility
Hi deighton,

only one thing to know, how to clear the listview?
0
 

Author Comment

by:cosie
Comment Utility
Hi deighton,

only one thing to know, how to clear the listview?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Listview1.Listitems.Clear

Cheers
0
 

Author Comment

by:cosie
Comment Utility
Thanx to all!
0
 

Expert Comment

by:AhmadKhan
Comment Utility
There are more options if u want.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now