Goals: trying to sort three numbers in descending order & output the three values in reverse alphabetic order.
Method: Input will be written by the user in 3 separate text-boxes and outputted in a read-only text-box.
My reasoning: [Trying to set up an array that stores the 3 values from each of the three text-boxes. After sorting, output will be prompted in an Output.Text.](http://i.imgur.com/ViAgX.png)
If user selects Numeric button the program should output the three values in numerically descending order.
If User selects Alphabetic button the program should output the three values in reverse alphabetic order.
Here's my current code:
Option Explicit On
Option Strict On
Option Compare Binary
Public Class theMainForm
Private Sub NumOrderBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumOrderBtn.Click
Dim num1 As Double 'Three values for each textbox
Dim num2 As Double
Dim num3 As Double
num1 = Val(num1Input.Text) 'Val retrieves input from textboxes
num2 = Val(num2Input.Text)
num3 = Val(num3Input.Text)
Dim randomNum As New Random()
For i = 0 To 3
numArray(i) = num1Input & num2Input & num3Input
Array.Sort(Array)
Output.Items.Add(numArray(i))
Next
End Sub
End Class
So how can I manage an array by storing values from the text-boxes? Then sort?
Appreciate any guidance given. Thanks.

New Topic/Question
Reply



MultiQuote








|