Solved

VB6 multiple column list box

Posted on 2016-08-27
3
22 Views
Last Modified: 2016-09-16
How to fill info into multiple columns of a list box at design time, in vb6?
0
Comment
Question by:Sia Azizi
3 Comments
 
LVL 7

Assisted Solution

by:Scobber
Scobber earned 250 total points (awarded by participants)
ID: 41773489
its been a while for me an VB6
but it goes along the lines of
your listbox is called ListView1

you say
listview1.columnheaders.add "First"
listview1.columnheaders.add "Second"
listview1.columnheaders.add "Third"

dim x as new listviewitem
x.value = "Value One"
x.subitems(1) = "Value Two"
x.subitems(2) = "Value Three"
listview1.items.add(x)

Open in new window

0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 250 total points (awarded by participants)
ID: 41773790
While you can have multiple columns in a listbox, you really don't want to since multicolumn listboxes are hard to work with. You should use a listview control instead. The Lisview control is a part of Microsoft Windows Common Controls-3 6.0. Here's a complete example of using a listview and adding sort arrows to the column headers.
Project1.zip
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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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