Actually, you may be working harder than you need to be.
First off, you need an array for the averages as well.
Say, Average(1 to maxStudents) as Integer.
Then you need a procedure that computes the averages. Basically, a for..next loop that assigns average(x) = (score1(x) + score2(x)) / 2.
The high score for test one can be done with a function that has a for..next loop that initializes to maxValue to score(1), then sees if score(x) is greater than maxValue.
Highest average is the same deal, just based off of the average array.
See below for example:
Private Function HighestAverageScore()
Dim x As Integer, maxValue As Integer
maxValue = average(1)
'initializing to the first value
For x = 1 To numStudents
if maxValue < average(x) then
maxValue = average(x)
End if
Next x
HighestAverageScore = maxValue
End Function
Lowest average would be the same function, just switch to a >, and change the name to minValue, etc.
The actual printing can be done in the cmd_click events. Say, make a button that says Print Highest Average called cmdPrintHigh. All it has to do is say picDisplay.Print "The Highest Average Score is " & HighestAverageScore & "."
Also, your add function needs to store the data in the arrays.
Assign numstudents to zero at the beginning of the program.
inside your add procedure,
just assign the value to the array.
you're already incrementing, so you just say
studentNames(numStudents) = txtname.Text
score1(numstudents) = txtscore1.Text
score2(numStudents) = txtscore2.text
I don't have VB installed presently, so I haven't run the code through any sort of tests, I just offered the VB pseudocode to illustrate what I'm talking about. Hope I was helpful, and if you have any questions about what I'm talking about, feel free to drop me an email.
Viper Out
Edited to add, that theoretically you should pass any arrays your function will be working on in as parameters... but VB doesn't make you do that (and it's not entirely relevent for beginning level programming).