Link to home
Start Free TrialLog in
Avatar of m_durnell
m_durnellFlag for United Kingdom of Great Britain and Northern Ireland

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





ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial