Código vb2008:
Ver original
private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rest, letra As String Dim x As Integer Dim y As String rest = TextBox5.Text letra = TextBox6.Text For x = 0 To rest.Length - 1 MessageBox.Show(rest(x)) If rest.Substring(x, 1) = TextBox5.Text(0) Then TextBox1.Text = rest(x) ElseIf rest.Substring(x, 1) = TextBox5.Text(1) Then TextBox2.Text = rest(x) ElseIf rest.Substring(x, 1) = TextBox5.Text(2) Then TextBox3.Text = rest(x) Else TextBox4.Text = rest(x) End If Next x
este es donde esta el random
Código vb2008:
Ver original
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim rand As New Random nume = rand.Next(0, 4) x = ListBox1.Items(nume) TextBox5.Text = x