Hi i keep getting an error here and cant seem to fix it :/
VB CODE
ERROR:Code:Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click If ListBox1.Items(0).ToString = Nothing Then MsgBox("this is nothing") Else MsgBox("something is there") End If End Sub
System.ArgumentOutOfRangeException was unhandled
Message="InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index"
Now i know that the error means that there there is nothing in "0" but my code above should check that but its not :/
What have i done wrong ?
Thanks for any help




Reply With Quote