vb.net - FindItemWithText listview clickevent or itemchecked event -
I tried both events .. But the result is always the same. I have two list views (lvMessage and lvContact)
lvMessage (1 LesViv - Item SIM card) index 0 | Null
index 1 | Cell number - (I can say {"1234", "2468"})
Index 2 | Date and time
Index 3 | Message
lvContact (second list view)
index 0 | Id
index 1 | Name - (I can say {"Chris", "Mark", "Cedric"})
Index 2 | Number - (I can say that I have {"1234", "2468"})
This is my code:
Moderate ChkContact form new ListViewItem dim as TheText ListViewItem = Me.lvMessage.Items (0) ChkContact = lvContact2.FindItemWithText (TheText.SubItems (1). Text.ToString) If ChkContact isNot nothing txtContact.Text = ChkContact.SubItems (1 ). Text lvMessage.FocusedItem.SubItems (0). Text = ChkContact.SubItems (1). Text next txtContact.Text = "no mail found" lvMessage.FocusedItem.SubItems (0). Text = "Not in the list" End if
As a result, I always click on "Chris"
or click on the other rows < / P>
Please help me in my first list view (lvMessage) .. I know that the code is working in FindItem but the result I want is always the same ...
Thanks
Here's a wild guess ..
Blind list ListViewItem = Me.lvMessage.Items (0)
This code will always select the first item on your lvMessage and it will always be "Chris"
TheText.SubItems (1) .textening
Try it out ..
View as a text list of slowIITIM = melv message. Item (0)
This will find the first selected item on your LavMosge.
Comments
Post a Comment