473,231 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 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 2678
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mad | last post by:
Hello to all, I am new to vb6 and I have been trying to make a listbox with a horizontal and vertical scrollbar. For example, like the one on the program Address book that is found on all Windows...
4
by: Bernie Yaeger | last post by:
I now know how to gather the file type icons and I'm able to use them in a listview. But a listbox does not have a .smallimagelist or .largeimagelist member, so I don't know how to translate that...
2
by: Kanaiya | last post by:
hello how to put images in either listbox or listview.bye. -- With regards, Gangani Kanaiya.
3
by: Chris | last post by:
I'm able to add a context menu to the right click on a listbox but it does not select the item in the listbox. I would like the context menu before it pops up to select the item that the mouse was...
2
by: John R. | last post by:
I want to have a listbox that shows a checkbox and a textbox. I created a user control that has a checkbox and a textbox in it and have been trying to add it to a listbox but I can't get it to...
1
by: Melson | last post by:
Hi May I know what is the differences between vb.net listbox and listview. When should I use listbox or listview. Regards Melson
3
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected...
1
by: The Confessor | last post by:
I currently have a listbox in my program which I populate with data from a random access file as follows: For T = 1 To HighestPointID FileGet(1, Point(T), T) ListBox_Point.Items.Add(T & " Lat:...
2
by: markliam | last post by:
I have a ListBox that is displaying a formatted string based on the contents of a DataSet. The purpose of the listbox is for the user to select an entry to delete, but I'm not sure how to match...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.