Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

How to retrieve a ListviewItem

Mar 21 2003 2:33 AM
Hi, I am new to c# (moving across from the VB6 world), and have a question which I haven't been able to figure out the answer to. Basically put, is there any way you can retrieve a ListviewItem by a key value (not the index). In VB this is very easy, for example; Dim loItem As MSComctlLib.ListItem With ListView1 .ListItems.Add , "prussell", "Paul Russell" .ListItems.Add , "dburton", "Dexter Burton" .ListItems.Add , "jthornton", "James Thornton" End With Set loItem = ListView1.ListItems("dburton") If Not loItem Is Nothing Then Debug.Print "Found Dexter Burton" End If Is there anyway that this can be done in c#? Any help would be greatly appreciated.

Answers (2)