Saturday, July 29, 2006

Problems with Index?

Hello Folks, listen to this, I was working with a code for an ImageViewer and I got this exception, a bad exception, specially beacuse I thought my code was good (Also the compiler). I found the solution, check it out. If you put that in listview, the user can only select one item, and if you try to handle the SelectIndexChanged event you might get a surprise, that is, when you select another item, for less than a second the selectedindex array will be empty, then you can imagine what comes next when you put code.
You already know, just put something like this

if listview1.selectedindex.count <> 0 then
'do want you want
end if

No comments: