Solved

Very EASYquestion, which control to use?

Posted on 2002-07-04
10
136 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send outlook email from VBS Script 2 66
Set WorkSheet  not Working 9 62
Outlook Macro to delete emails not meeting keywords 56 111
VBA Replace Function - What am I missing? 3 50
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

739 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