Solved

Simple ListView question

Posted on 2000-03-02
2
130 Views
Last Modified: 2010-05-02
I've got a database returning data to a Listbox, and I want to take the contents of the ListBox and display them in a ListView

Can somebody supply me with the code

Cheers,

Matt.
0
Comment
Question by:Matt_Unsworth
2 Comments
 
LVL 3

Accepted Solution

by:
paulstamp earned 10 total points
ID: 2577258
Assuming list1 and listview1 are the two controls :

    Dim nCount As Integer
   
    ListView1.View = lvwList
   
    If List1.ListCount > 0 Then
        For nCount = 0 To List1.ListCount - 1
            ListView1.ListItems.Add , , List1.List(nCount)
        Next nCount
    End If


That should do the trick
0
 

Author Comment

by:Matt_Unsworth
ID: 2579402
Simple, concise.....fitted straight into my code

Cheers paulstamp
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 65
Crystal reports - Formula Field code need assistance with code 17 81
VB6 - Compare and highlight cell not the same 3 53
Help me. 3 60
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

837 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