Function AddLabel(name As String, caption As String, i As Integer) As String
Dim myLabel As Label
Set myLabel = Me.Controls.Add("vb.Label", name)
myLabel.caption = caption
myLabel.BackStyle = 0
myLabel.Visible = True
myLabel.Top = 900 * (StudentIndex - 1) + i * 200
myLabel.Width = 6000
AddLabel = ""
End Function
Dim a As String
a = AddLabel("label" + CStr(StudentIndex) + "Sorce1", "Data_Array(" + CStr(StudentIndex) + ",1)=" + CStr(Sorce_arry(StudentIndex).Sorce1), 1)
a = AddLabel("label" + CStr(StudentIndex) + "Sorce2", "Data_Array(" + CStr(StudentIndex) + ",2)=" + CStr(Sorce_arry(StudentIndex).Sorce2), 2)
a = AddLabel("label" + CStr(StudentIndex) + "Sorce3", "Data_Array(" + CStr(StudentIndex) + ",3)=" + CStr(Sorce_arry(StudentIndex).Sorce3), 3)
a = AddLabel("label" + CStr(StudentIndex) + "Sorce4", "Data_Array(" + CStr(StudentIndex) + ",4)=" + CStr(Sorce_arry(StudentIndex).Sorce4), 4)
StudentIndex = StudentIndex + 1