Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
Me.lblpid.Text = Me.ListView1.SelectedItems(0).SubItems(0).Text
End Sub
here is my error:InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index
listview error in clicking
Page 1 of 11 Replies - 234 Views - Last Post: 28 March 2012 - 05:42 AM
#1
listview error in clicking
Posted 28 March 2012 - 05:19 AM
i have a listview that when i select the items on it, then the id would go to a lable but when i click for another item with different id it has an error here is my code:
Replies To: listview error in clicking
#2
Re: listview error in clicking
Posted 28 March 2012 - 05:41 AM
try
Private Sub ListView1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListView1.KeyDown
If e.KeyCode = Keys.Enter Then
If Not ListView1.SelectedItems.Count = 0 Then
With ListView1.SelectedItems(0)
lblpid.Text = ListView1.SelectedItems.Item(0).Text
End With
End If
End If
End Sub
This post has been edited by damdimdum: 28 March 2012 - 05:42 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|