Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42307

Listview item removal

$
0
0
Here is my code, where did I go wrong and what should I look at on changing?

Code:

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Try
            For i As Integer = 0 To ListView1.Items.Count
                ListView1.Items.RemoveAt(i)
            Next
        Catch ex As IndexOutOfRangeException
            MsgBox("Index is out of bounds" & vbCrLf & ex.Message)
        End Try

End Sub


Viewing all articles
Browse latest Browse all 42307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>