How to show a two dimensional array on a list box? Visual Basic 2012

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi I need to show a two dimensional array with two columns (one ID, other value) in a listbox. I read that listboxes can have more than one column. I tried this code and I set the multicolumn property of list box to true but it list all of array items with
no column Like this:(first index=row)(second index=column)
Listbox:
ID_array(0,0)
ID_array(0,1)
ID_array(1,0)
ID_array(1,1)
ID_array(2,0)
ID_array(2,1)...
<pre class="prettyprint lang-vb" style=" Dim a = From b In ID_array
Select b
ListBox1.DataSource = a.ToList[/code]
but I want two column in List box:
ID_array(0,0) | ID_array(0,1)
ID_array(1,0) | ID_array(1,1)
ID_array(2,0) | ID_array(2,1)
... | ...

<br/>

<br/>
<br/>

View the full article
 
Back
Top