PDA

View Full Version : Error during compile



austenr
02-08-2010, 02:28 PM
I get this error when debugging this code:

Too few type arguments to 'System Collections Generic List(OfT)'



Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Dim list As New List(Of String), index As Integer
list.AddRange(IO.Directory.GetFiles("C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\images", "*.jpg"))
Me.PictureBox1.ImageLocation = list(index)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim index As Integer
index += 1
If index = List.Count Then index = 0
Me.PictureBox1.ImageLocation = List(index)

End Sub

The error refers to List.Count and List(index)

Thanks