i have a combobox that contains the items 0001,0002,0003, etc. i have a listview with 3 columns namely ID, Name , Age. I want to do is when i select the ID "0001" in the combobox, it will display the name and the age in the textbox1 and textbox2 that is from the listview . Thank you
jontennyeah
-1
Light Poster
Recommended Answers
Jump to PostTry something like this:
For Each lviItem As ListViewItem In ListView1.Items If lviItem.Text = ComboBox1.Text Then TextBox1.Text = lviItem.SubItems(0).Text TextBox2.Text = lviItem.SubItems(1).Text End If Next
Jump to PostSame, except I'd add "Exit For" after line 4.
All 5 Replies
Begginnerdev
256
Junior Poster
Reverend Jim
4,612
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Reverend Jim
4,612
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
jontennyeah
-1
Light Poster
Reverend Jim
4,612
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.