Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim arr(6) As Double
arr(1) = CDbl(TextBox1.Text)
arr(2) = CDbl(TextBox2.Text)
arr(3) = CDbl(TextBox3.Text)
arr(4) = CDbl(TextBox4.Text)
arr(5) = CDbl(TextBox5.Text)
arr(6) = CDbl(TextBox6.Text)
Call BubbleSort(arr)
TextBox1.Text = CStr(arr(1))
TextBox2.Text = CStr(arr(2))
TextBox3.Text = CStr(arr(3))
TextBox4.Text = CStr(arr(4))
TextBox5.Text = CStr(arr(5))
TextBox6.Text = CStr(arr(6))
End Sub
Sub BubbleSort(ByVal List() As Double)
Dim first, last, temp As Double
Dim i, j As Integer
first = LBound(List)
Last = UBound(List)
For i = first To last - 1
For j = i + 1 To last
If List(i) > List(j) Then
temp = List(j)
List(j) = List(i)
List(i) = temp
End If
Next
Next
End Sub