Listview contain subitem text

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Listview contain subitem text
AnoPem
How can i check if a listview contains a subitem with the same text as textbox1.text ?
https://t.me/pump_upp
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Re: Listview contain subitem text
MrAksel
Code: Select all
Public Sub FindItem()
   For Each item As ListViewItem In ListView1.Items
     For Each subItem As ListViewItem.ListViewSubItem In item.SubItems
       If subItem.Text = TextBox1.Text Then
          'Found it'
          Exit Sub
       End If
     Next
   Next
End Sub
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: Listview contain subitem text
AnoPem
MrAksel wrote:
Code: Select all
Public Sub FindItem()
   For Each item As ListViewItem In ListView1.Items
     For Each subItem As ListViewItem.ListViewSubItem In item.SubItems
       If subItem.Text = TextBox1.Text Then
          'Found it'
          Exit Sub
       End If
     Next
   Next
End Sub
Thank you :)
https://t.me/pump_upp
3 posts Page 1 of 1
Return to “Coding Help & Support”