473,769 Members | 4,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multicolumn Listbox

WRH
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...

this.listBox3.I tems.AddRange(n ew object[]
{
"Item 1, column 1",
"Item 2, column 1",
"Item 3, column 1",
"Item 4, column 1",
"Item 5, column 1",
"Item 1, column 2",
"Item 2, column 2",
"Item 3, column 2" });

It works perfectly, with column 1 items is column one and column 2
items in column 2. Now here's why I posted...I don't understand the
example! What is there that results in a two column list with 5 lines
in column 1 and 3 lines in column 2?


Oct 22 '07 #1
5 17763
Hi,

Each object is a comma separated list of values so I assume that the listbox
expect that you define the columns that way.

You failed to mention if this is a web or a win example ( I assume that a
window)

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
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...

this.listBox3.I tems.AddRange(n ew object[]
{
"Item 1, column 1",
"Item 2, column 1",
"Item 3, column 1",
"Item 4, column 1",
"Item 5, column 1",
"Item 1, column 2",
"Item 2, column 2",
"Item 3, column 2" });

It works perfectly, with column 1 items is column one and column 2
items in column 2. Now here's why I posted...I don't understand the
example! What is there that results in a two column list with 5 lines
in column 1 and 3 lines in column 2?


Oct 22 '07 #2
WRH
Thanks for the quick reply.
Further testing shows that the last 3 items went into column 2 only
because of the height of the listBox (No vertical scroll) What I want
is to specify the column for an item.

Using windows forms, MS VC# 2005 express edition
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi,

Each object is a comma separated list of values so I assume that the
listbox expect that you define the columns that way.

You failed to mention if this is a web or a win example ( I assume that a
window)

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>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...

this.listBox3.I tems.AddRange(n ew object[]
{
"Item 1, column 1",
"Item 2, column 1",
"Item 3, column 1",
"Item 4, column 1",
"Item 5, column 1",
"Item 1, column 2",
"Item 2, column 2",
"Item 3, column 2" });

It works perfectly, with column 1 items is column one and column 2
items in column 2. Now here's why I posted...I don't understand the
example! What is there that results in a two column list with 5 lines
in column 1 and 3 lines in column 2?



Oct 22 '07 #3
Hi,

You have to read the docs and see what format ListBox expect for
multicolumns lists.

I just found the txt:
A multicolumn ListBox places items into as many columns as are needed to
make vertical scrolling unnecessary. The user can use the keyboard to
navigate to columns that are not currently visible. Set the
HorizontalScrol lbar property to true to display a horizontal scroll bar that
enables the user to scroll to columns that are not currently shown in the
visible region of the ListBox. The value of the ColumnWidth property
determines the width of each column.

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Thanks for the quick reply.
Further testing shows that the last 3 items went into column 2 only
because of the height of the listBox (No vertical scroll) What I want
is to specify the column for an item.

Using windows forms, MS VC# 2005 express edition
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Hi,

Each object is a comma separated list of values so I assume that the
listbox expect that you define the columns that way.

You failed to mention if this is a web or a win example ( I assume that a
window)

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2******* *********@TK2MS FTNGP06.phx.gbl ...
>>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...

this.listBox3.I tems.AddRange(n ew object[]
{
"Item 1, column 1",
"Item 2, column 1",
"Item 3, column 1",
"Item 4, column 1",
"Item 5, column 1",
"Item 1, column 2",
"Item 2, column 2",
"Item 3, column 2" });

It works perfectly, with column 1 items is column one and column 2
items in column 2. Now here's why I posted...I don't understand the
example! What is there that results in a two column list with 5 lines
in column 1 and 3 lines in column 2?




Oct 22 '07 #4
WRH
Thanks again for the info.

I have decided to use ListView instead, as it seems much
more manageable with regard to columns.

I could not be sure what the user may see at any given
time with a multicolumn ListBox!

"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
message news:u9******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,

You have to read the docs and see what format ListBox expect for
multicolumns lists.

I just found the txt:
A multicolumn ListBox places items into as many columns as are needed to
make vertical scrolling unnecessary. The user can use the keyboard to
navigate to columns that are not currently visible. Set the
HorizontalScrol lbar property to true to display a horizontal scroll bar
that enables the user to scroll to columns that are not currently shown in
the visible region of the ListBox. The value of the ColumnWidth property
determines the width of each column.

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>Thanks for the quick reply.
Further testing shows that the last 3 items went into column 2 only
because of the height of the listBox (No vertical scroll) What I want
is to specify the column for an item.

Using windows forms, MS VC# 2005 express edition
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote
in message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>>Hi,

Each object is a comma separated list of values so I assume that the
listbox expect that you define the columns that way.

You failed to mention if this is a web or a win example ( I assume that
a window)

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2****** **********@TK2M SFTNGP06.phx.gb l...
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...

this.listBox3.I tems.AddRange(n ew object[]
{
"Item 1, column 1",
"Item 2, column 1",
"Item 3, column 1",
"Item 4, column 1",
"Item 5, column 1",
"Item 1, column 2",
"Item 2, column 2",
"Item 3, column 2" });

It works perfectly, with column 1 items is column one and column 2
items in column 2. Now here's why I posted...I don't understand the
example! What is there that results in a two column list with 5 lines
in column 1 and 3 lines in column 2?




Oct 22 '07 #5
Hi,
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"WRH" <no****@videotr on.cawrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Thanks again for the info.

I have decided to use ListView instead, as it seems much
more manageable with regard to columns.

I could not be sure what the user may see at any given
time with a multicolumn ListBox!
Wise decision, Listview is the control for that.
Oct 23 '07 #6

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

Similar topics

1
33946
by: Mazin Al-Noaimi | last post by:
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 ....
4
2629
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 goodness of my brain, I cant seem to find it anywhere and just not able to do a "using System.WIndows.form". WHere on earth can I get this work? Please help! I just need a simple multicolumn listbox. Why is this so difficult? :(
6
3211
by: Lars Netzel | last post by:
I have ask this before and I got a link to a solution where you actually show a new from on top of everything with a listbox in, where you can have multicolumns.. and that's what I use now.. That look sokay but it's not a true Combobox... at all.. So my my customer wants to be able to type stuff into the textfield of combobox and then it's preselected in the list... With the solution I got that' simposiible.. since there are no real...
1
5056
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 top of the listbox eg. 5, 10, 'Go' As I need multiple rows of data I have a button to 'Load' this to the listbox. I'm stuck though as I'm having difficulty loading this correctly. Question: Woulkd I be better off with a datagrid for this job,...
7
6121
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
1
1809
by: mkhmer | last post by:
I am now trying to add a listbox with multicolumn data item into my ASP.Net page using VB.net language, but it seems to be impossible. Anybody got clue on this? Your suggestion is warmly appreciated. Thanks MKhmer
2
2039
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. I have dont it quite simply with ease in Access but here i am blank. 1.I want to show Three column in the list box. 2. I would populate this with the help of a query which picks data from two tables
6
35090
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 be displayed in the listbox (first name in column 0 and last name in column 1). Can anyone help me with what list function I should use? I've tried using listbox.additem function passing array as parameter, but that does not work. Any help would...
3
5644
balabaster
by: balabaster | last post by:
Hey guys and gals, I'm not sure if this is the simplest way to do this or if someone can throw any other ideas out there. I'm looking to build a treeview inside a listbox...or have a multicolumn treeview. Having done some research it seems there was some rather extensive and laborious methods for achieving such an effect in VB6 but none of them satisfactory and the only method I can find that looks anywhere near like it might possibly be...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.