Well this used to be my generate button:
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Low As Integer = 1 Dim High As Integer High = TextBox1.Text Low = TextBox2.Text For i As Integer = Low To High 'Add the numbers to the collection. list.Add(i) Next i Dim rand As New Random Dim index As Integer Dim item As Object 'Display the items in random order. 'While list.Count > 0 'Choose a random index. index = rand.Next(0, list.Count) 'Get the item at that index. item = list(index) 'Remove the item so that it cannot be chosen again. list.RemoveAt(index) 'Display the item. TextBox3.Text = item.ToString ListBox1.Items.Add(TextBox3.Text) 'End While Form3.Close() Form3.Show() tmrWait.Interval = 5000 tmrWait.Start() End Sub
And more specifically these two lines:vb Code:
TextBox3.Text = item.ToString ListBox1.Items.Add(TextBox3.Text)
This would then put the generated number in the listbox and textbox. The reason I need it in both is that I duplicate the text from the textbox and copy it to another form that is my display screen.
That help a bit more?




Reply With Quote