| | |
Multi Column List Boxes
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 86
Reputation:
Solved Threads: 0
Hello everyone. I would like to learn how to make a multi column list box. I have set the multi column Boolean to true and set the width but i have yet to see the two columns. I only see one.
I currently have a .csv file and in the format of:
Id, Name
I would like the listbox to have a column for Ids and Names. How would i be able to achieve this?
I currently have a .csv file and in the format of:
Id, Name
I would like the listbox to have a column for Ids and Names. How would i be able to achieve this?
Last edited by jhonnyboy; Mar 31st, 2009 at 2:16 pm.
Multi column listbox doesn't actually show items in multiple columns. It "wraps" items to the next column when you add them and the number of the items reaches the listbox's height.
If you want to show items in two columns, you'll have to use some grid control or listview control.
Here's an example with listview control
If you want to show items in two columns, you'll have to use some grid control or listview control.
Here's an example with listview control
VB.NET Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim TempStr(1) As String Dim TempNode As ListViewItem ' Show "hidden" text ListView1.ShowItemToolTips = True ' Set columnar mode ListView1.View = View.Details ' Set column header ListView1.Columns.Clear() ListView1.Columns.Add("UserID", 80) ListView1.Columns.Add("Name", 120) ' Remove previous items ListView1.Items.Clear() ' Add two items TempStr(0) = "1111" TempStr(1) = "Doe, John" TempNode = New ListViewItem(TempStr) ListView1.Items.Add(TempNode) TempStr(0) = "2222" TempStr(1) = "Doe, Jane" TempNode = New ListViewItem(TempStr) ListView1.Items.Add(TempNode) End Sub
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- C++ Multi-Column Listbox (C++)
- The most famous CSS web sites galleries in the world (HTML and CSS)
- Insert Selected data In MySQL (PHP)
- cant acess some websites and some programs wont connect to the net. (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: StreamWriter Is Overriding Already Written Items in File
- Next Thread: Starting a Program using VB Module
Views: 1336 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add application array assignment basic box button buttons center class click code combo convert cpu data database datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan picturebox port print printing printpreview problem record refresh regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml





