Hi,

Dim boxArr As New ArrayList()


Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = 13 Then
boxArr.Add(Val((TextBox1.Text))) 'Add text into the array
ListSort() 'Sort the array
TextBox1.Clear() 'Clear text ready for next one
End If
End Sub

Private Sub ListSort()
boxArr.Sort()
Dim i As Int16
ListBox1.Items.Clear() 'Clear list
For i = 0 To boxArr.Count - 1
ListBox1.Items.Add(boxArr(i))
Next
End Sub

Have a nice day