Solved

Very EASYquestion, which control to use?

Posted on 2002-07-04
10
133 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
ID: 7129547
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
ID: 7129561
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
ID: 7129598
the most simple component is the MSFlexgrid (in my opinion)
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7129600
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
ID: 7129727
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:cosie
ID: 7129772
Hi deighton,

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

Author Comment

by:cosie
ID: 7129782
Hi deighton,

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

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7129830
Listview1.Listitems.Clear

Cheers
0
 

Author Comment

by:cosie
ID: 7129859
Thanx to all!
0
 

Expert Comment

by:AhmadKhan
ID: 7131024
There are more options if u want.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 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

22 Experts available now in Live!

Get 1:1 Help Now