Well i whipped up this function:
Function findLowestNum(ByVal textBoxArray As ArrayList) As Integer
Dim textBox As TextBox = CType(textBoxArray.Item(0), TextBox)
Dim currentMin As Integer = textBox.Text
For i As Integer = 0 To textBoxArray.Count - 1
textBox = CType(textBoxArray.Item(i), TextBox)
If currentMin > textBox.Text Then
currentMin = textBox.Text
End If
Next
Return currentMin
End Function
So let's say you're gonna find the lowest number in the 5 textboxes, we can do this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim textBoxArray As New ArrayList
textBoxArray.Add(Me.TextBox1)
textBoxArray.Add(Me.TextBox2)
textBoxArray.Add(Me.TextBox3)
textBoxArray.Add(Me.TextBox4)
textBoxArray.Add(Me.TextBox5)
MessageBox.Show(Me.findLowestNum(textBoxArray))
End Sub
Dodgy, but you'd get the idea.