471,853 Members | 859 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

ListBox or ListView?

CR
In VB6 if I wanted to display a group of records, and possibly allow
the user to select one or more records, I would use the ListBox. For
example suppose I wanted to display something like this:

Name Address Phone Number
Johnson 111 South Av 111-1111
Smith 222 Main St 222-2222

In VB6 I would use a label and a listbox. The label would contain the
header. To make the columns line up in the listbox I would use a
"fixed length" font. Then I would pad each listbox entry with spaces
in between each field. It was easy to do but I'm wondering if there is
a better way in .NET.

Thanks!

Chuck.
Nov 20 '05 #1
4 2593
"CR" <cr***@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
In VB6 I would use a label and a listbox. The label would contain the
header. To make the columns line up in the listbox I would use a
"fixed length" font. Then I would pad each listbox entry with spaces
in between each field. It was easy to do but I'm wondering if there is
a better way in .NET.


FYI, ListView was available in VB 6 as well, and has been around since
Windows95T. I personally always opt for the ListView over the list when I
am dealing with more than one column of data.

The [old] ListBox has a "Columns" property that would have lined the data up
for you, without using a fixed width font. The new one may have this same
property, but I haven't looked.
HTH,
Jeremy

Nov 20 '05 #2
* cr***@hotmail.com (CR) scripsit:
In VB6 if I wanted to display a group of records, and possibly allow
the user to select one or more records, I would use the ListBox. For
example suppose I wanted to display something like this:

Name Address Phone Number
Johnson 111 South Av 111-1111
Smith 222 Main St 222-2222

In VB6 I would use a label and a listbox. The label would contain the
header. To make the columns line up in the listbox I would use a
"fixed length" font. Then I would pad each listbox entry with spaces
in between each field. It was easy to do but I'm wondering if there is
a better way in .NET.


.... a ListView with 'Columns' and 'View' = 'Details' (items + subitems).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Jeremy,

From what I remember the of the ListBox the columns property allow the data
to wrap around so that you could sroll horizontally to see the list data and
could not be use to display data as the OP desires.

Dan

"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote in message
news:QF*********************@twister.tampabay.rr.c om...
"CR" <cr***@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
In VB6 I would use a label and a listbox. The label would contain the
header. To make the columns line up in the listbox I would use a
"fixed length" font. Then I would pad each listbox entry with spaces
in between each field. It was easy to do but I'm wondering if there is
a better way in .NET.
FYI, ListView was available in VB 6 as well, and has been around since
Windows95T. I personally always opt for the ListView over the list when I
am dealing with more than one column of data.

The [old] ListBox has a "Columns" property that would have lined the data

up for you, without using a fixed width font. The new one may have this same
property, but I haven't looked.
HTH,
Jeremy

Nov 20 '05 #4
CR
hi***************@gmx.at (Herfried K. Wagner [MVP]) wrote in message news:<uX**************@TK2MSFTNGP12.phx.gbl>...
* cr***@hotmail.com (CR) scripsit:
In VB6 if I wanted to display a group of records, and possibly allow
the user to select one or more records, I would use the ListBox. For
example suppose I wanted to display something like this:

Name Address Phone Number
Johnson 111 South Av 111-1111
Smith 222 Main St 222-2222

... a ListView with 'Columns' and 'View' = 'Details' (items + subitems).


That's what I'm looking for.

Thanks!

Chuck.
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Mad | last post: by
3 posts views Thread by Chris | last post: by
2 posts views Thread by John R. | last post: by
3 posts views Thread by thomasp | last post: by
1 post views Thread by The Confessor | last post: by
2 posts views Thread by markliam | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.