este es mi 2 post aver si les interesa
utilizaremos el programa visual studio 2008.
1 creamos un new project (de tipo windows form) y creamos la interfaz
(http://img510.imageshack.us/img510/336/95297141.png)
2 en el boton el siguiente codigo
Dim aleatorio As Integer()
Dim r As New Random
ReDim aleatorio(2)
'asignando valores
For i As Integer = 0 To aleatorio.Length - 1
aleatorio(i) = r.Next(1, 5)
TextBox1.Text = aleatorio(i)
Next
For j As Integer = 0 To aleatorio.Length - 1
aleatorio(j) = r.Next(1, 5)
TextBox2.Text = aleatorio(j)
TextBox1.Text = aleatorio(j)
Next
For k As Integer = 0 To aleatorio.Length - 1
aleatorio(k) = r.Next(1, 5)
TextBox3.Text = aleatorio(k)
If TextBox2.Text = aleatorio(k) Then
MessageBox.Show("ganastes")
End If
Next
no es recomendable poner el codigo en los botones... segun los patrones de diseño :rolleyes: