我正在尝试创建一个处理医院患者文件的应用程序。它给了我一个错误并告诉我PatientView = PatientCollection(counter) - ArgumentOutOfRangeException 未处理。这是什么意思,我该如何解决?
Public Class SelectPatient
Private Sub SelectPatient_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label1.Text = "Select Patient"
Dim counter As Integer = 0
ComboBox1.Items.Clear()
For counter = 0 To PatientCollection.Count
Dim PatientView As New PatientObject4
PatientView = PatientCollection(counter)
ComboBox1.Items.Add(PatientView.LastName & "," & PatientView.Firstname)
Next
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
CollectionIndexValue = ComboBox1.SelectedIndex
Globals.NewPatientData()
End Sub
End Class
非常感谢你花时间陪伴。非常感激