m_durnell
asked on
vb 2008 array help generating numbers and putting them into text boxes
Hi,
I have the following code and need to know how to get an array of numbers and place them into boxes (with no duplicates)
The code that I have is shown below:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Randomize()
' Generate random value between 1 and 6.
Dim value As Integer = CInt(Int((6 * Rnd()) + 1))
TextBox1.Text = value
End Sub
I have 6 textboxes numbered as follows textbox1, textbox2 etc
I want the numbers to be random but no repeat numbers
Regards
I have the following code and need to know how to get an array of numbers and place them into boxes (with no duplicates)
The code that I have is shown below:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Randomize()
' Generate random value between 1 and 6.
Dim value As Integer = CInt(Int((6 * Rnd()) + 1))
TextBox1.Text = value
End Sub
I have 6 textboxes numbered as follows textbox1, textbox2 etc
I want the numbers to be random but no repeat numbers
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.