The problem is that on line 3 it has fixed numbers, whereas in this program there are random generated numbers which are the text for each button here are the codes for each button and and the code for the go button which is meant to:
1) show the listbox with sorted of the 6 buttons in ascending order which it does nicely.
2)display either blue or red fonted label depending if both listbox and textbox text match.
Code for go button:
Code:
Private Sub btnGo_Click(sender As System.Object, e As System.EventArgs) Handles btnGo.Click
strnumbers(0) = CStr(btnNumberButton1.Text)
strnumbers(1) = CStr(btnNumberButton2.Text)
strnumbers(2) = CStr(btnNumberButton3.Text)
strnumbers(3) = CStr(btnNumberButton4.Text)
strnumbers(4) = CStr(btnNumberButton5.Text)
strnumbers(5) = CStr(btnNumberButton6.Text)
For num As Integer = 0 To strnumbers.Length - 1
Array.Sort(strnumbers)
listarrays.Items.Add(strnumbers(num))
Next
Dim x As Integer
Dim s As String() = New String(5) {strnumbers(0), strnumbers(1), strnumbers(2), strnumbers(3), strnumbers(4), strnumbers(5)}
listarrays.Items.AddRange(s)
TextBox1.Text = "0 2 3 5 7 8"
For Each item In listarrays.Items
If item.ToString = TextBox1.Text.Split(" ")(x) Then
MsgBox("matching " + item.ToString)
End If
x += 1
Next
ProgressBar1.Increment(+12.8)
listarrays.Visible = True
lblAnswer.Visible = True
End Sub
code for button(its the same for all the buttons)
Code:
Private Sub btnNumberButton1_Click(sender As System.Object, e As System.EventArgs) Handles btnNumberButton1.Click
TextBox1.Text = TextBox1.Text + " " + btnNumberButton1.Text
btnNumberButton1.Enabled = False
ProgressBar1.Increment(+12.8)
btnPlay.Enabled = False
End Sub
the bolded bit is the bit im stuck on everything else is smooth.