| | |
Custom Controls (Checkbox / List)
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Oct 2008
Posts: 6
Reputation:
Solved Threads: 0
Hi, I'm not too experienced with .NET programming, but I was wondering if anyone knows of a custom control in VB.NET that involves a list (sort of like a ListBox), with at least 2 columns, and the ability to select individual members of this list. I basically have a dynamic NameValueCollection I would like to populate this list with and allow users to select different items.
Does anyone know of a pre-made control like this?
Does anyone know of a pre-made control like this?
You'll get that with ListView control.
Fill ListView control:
and check where the mouse was clicked:
Of course you can have more than two columns if you need.
Fill ListView control:
VB.NET Syntax (Toggle Plain Text)
Dim TempStr(1) As String Dim NewNode As ListViewItem ListView1.View = View.Details ' FullRowSelect has to be True ListView1.FullRowSelect = True ListView1.Columns.Clear() ListView1.Columns.Add("Column1", 100) ListView1.Columns.Add("Column2", 100) ListView1.Items.Clear() TempStr(0) = "foo" TempStr(1) = "bar" NewNode = New ListViewItem(TempStr) ListView1.Items.Add(NewNode) TempStr(0) = "another" TempStr(1) = "item" NewNode = New ListViewItem(TempStr) ListView1.Items.Add(NewNode)
VB.NET Syntax (Toggle Plain Text)
Private Sub ListView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseClick Dim HTInfo As ListViewHitTestInfo = ListView1.HitTest(e.Location) Dim TempStr As String HTInfo = ListView1.HitTest(e.Location) TempStr = HTInfo.SubItem.ToString MessageBox.Show(TempStr, _ "SubItem", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information) End Sub
Teme64 @ Windows Developer Blog
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Incorrect Collating Sequence Error
- Next Thread: Crystal Report - Dynamic Design
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic box button buttons center check code component connectionstring convert crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel fade file-dialog firewall folder ftp generatetags hardcopy image images input insert intel isnumericfuntioncall math monitor navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project record reports" savedialog searchvb.net select serial shutdown string survey tcp temp temperature text textbox timer toolbox trim updown user useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





