hi. i'm have 2 form and a listview in form1 with items, but when the row has no item in it,like row 4 until row 8, an error showed up like this "InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index". can someone help me fix this? i need to pass the value from listview into labels and if row 4 until 8 is empty, the label will be label4.text = ""
Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
Formreceipt.Label1.Text = lvlist2.Items(0).SubItems(1).Text
Formreceipt.Label2.Text = lvlist2.Items(1).SubItems(1).Text
Formreceipt.Label3.Text = lvlist2.Items(2).SubItems(1).Text
Formreceipt.Label4.Text = lvlist2.Items(3).SubItems(1).Text
Formreceipt.Label5.Text = lvlist2.Items(4).SubItems(1).Text
Formreceipt.Label6.Text = lvlist2.Items(5).SubItems(1).Text
Formreceipt.Label7.Text = lvlist2.Items(6).SubItems(1).Text
Formreceipt.Label8.Text = lvlist2.Items(7).SubItems(1).Text
Formreceipt.Show()
End Sub