473,408 Members | 1,676 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,408 software developers and data experts.

Multicolumn ListBox

Hi all,

I want to add three values each time to the list box to be as one record

for example

I have first name, last name, phone number values
I want to add them to a listbox once to be three column

so can any body help in this particle code ....
Nov 16 '05 #1
1 33856
Hi

First of all you need to set the ListView propery View to Details. With the following code you can add columns (headers)

listView1.Columns.Add("First name", 150, HorizontalAlignment.Left)
listView1.Columns.Add("Last name", 150, HorizontalAlignment.Left)
listView1.Columns.Add("Phone number", 150, HorizontalAlignment.Left)

And with this code you can add data to the listview:

ListViewItem item = new ListViewItem()

item.Text = "John";
item.SubItems.Add ("Doe")
item.SubItems.Add ("000000000")

listView1.Items.Add (item);

Hope it helps

Peter
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: kackson | last post by:
Hi. I attempted to create a multicolumn listbox for my web based aspx application. I search the net, all I get is something like listview or I need to have system.windwos.form. But for the...
1
by: zoneal | last post by:
Hi I have a form with a listbox, two comboboxes and two Radiobuttons. What I want to do is make a selection from both comboboxes and either Radiobutton and display these three elements across the...
7
by: Paul Bromley | last post by:
How can I use this please - I need 2 columns. I have been having difficulty finding info on this and the 2005 Treeview control today. Many thanks for any links or info, Paul Bromley
5
by: matthewtec | last post by:
I see that it is possible to have a multicolumn ListBox: lstOne.MultiColumn = True lstOne.ColumnWidth = 10 but the only way I have seen to have the items in the listbox print in the next...
2
by: dev.amit | last post by:
Hello Friends I am a new bee to the world of vb. I have an appication in the MS Access and now i have to convert it to the Vb. I am having problem creating multicolumn Listbox in the vb form....
6
by: is49460 | last post by:
Hello! I have two textboxes and a multicolumn listbox on the form. User enters first name in one textbox and last name in the other. After "submit" button is clicked I want first and last name to...
5
by: WRH | last post by:
Hello I want to have a multicolumn listbox. I never used one before so I looked at a Help example. I set the multicolumn property and the column width and tested with this example... ...
2
OuTCasT
by: OuTCasT | last post by:
hi i have 2 queries that i would like to insert next to each other into 1 listbox. eg City Countains ------------------------------------------- Johannesburg ...
1
by: TravelingCat | last post by:
Hello, I'm wondering whether it's possible to not show one specific column's heading in a listbox, does anyone know? My column heads property is set to yes, but there's one column, ordinal number,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.