Question 2 Problems with ListView

J. Scott Elblein

Well-known member
Joined
Dec 14, 2006
Messages
166
Location
Chicago
Programming Experience
10+
My 1st problem:
I am encountering a problem with the listview, where it won't let me highlight it's FIRST row, or check/uncheck the checkbox in it via clicking. However, I can still access it's items via code. I have it set to Details view, with a checkbox, an icon and 1 subitem. Am I missing some setting/property to allow me to use the mouse on the first row? All other rows are behaving normally.

My second problem:
is that I am using the webbrowser_documentcompleted event, along with .contains to look for a matching page, and when found, I want it to store the first item in the listview to a variable.

It is breaking and detecting the page properly, however, once I execute this following line of code:

(Note: I am using selectedindices because ultimately I want to loop this code, fetching only the checked items in the list). The second subitem is never used during the looping. This is something of a web submission app, and the second subitem just says "Submitting/Submitted"

VB.NET:
Dim strFriends As String = Me.lvFriends.Items.Item(Me.lvFriends.SelectedIndices.Item(0)).SubItems(0).Text

It just stops executing any code after that. I dont understand why just trying to store the item's string in a variable would cause it to stop executing any following code?

TIA
 
Last edited:
Back
Top