Solved

Very EASYquestion, which control to use?

Posted on 2002-07-04
10
135 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 143

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
 

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 143

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 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