I have a checkbox that when clicked is supposed to highlight all entries in a listbox, but i keep getting an error that says to use the New keyword when creating an instance of an object, but I can't figure out where to use it. this is the sub:
Private Sub chkSelectAll1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSelectAll1.CheckedChanged
Dim i As New Integer
If chkSelectAll1.Checked Then
For i = 0 To Me.lstFileList.Items.Count - 1
Me.lstFileList.SelectedItem(i) = True
Next i
End If
End Sub
Can you see what might be wrong here?
Thanks
(vb.net 2005 winform)
Private Sub chkSelectAll1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSelectAll1.CheckedChanged
Dim i As New Integer
If chkSelectAll1.Checked Then
For i = 0 To Me.lstFileList.Items.Count - 1
Me.lstFileList.SelectedItem(i) = True
Next i
End If
End Sub
Can you see what might be wrong here?
Thanks
(vb.net 2005 winform)