Bonjour a tous,
J'ai crée une petite application pour choisir au hasard 7 chiffres sur un total de 100.
L'application, fonctionne très bien mais je n'arrive pas a faire en sorte que le système ne choisisse qu'une seule fois le nombre.
Par exemple : sur les 100 nombres, j'obtiens 7, 36, 30, 85, 41, 19, 36, et je voudrais obtenir 7 nombres différents.
Mon code est le suivant :
Private
Sub
Button1_Click(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
Randomize()
Me
.TextBox1.Text =
CInt
(Int((100 * Rnd()) + 1))
Me
.TextBox2.Text =
CInt
(Int((100 * Rnd()) + 1))
Me
.TextBox3.Text =
CInt
(Int((100 * Rnd()) + 1))
Me
.TextBox4.Text =
CInt
(Int((100 * Rnd()) + 1))
Me
.TextBox5.Text =
CInt
(Int((100 * Rnd()) + 1))
Me
.TextBox6.Text =
CInt
(Int((100 * Rnd()) + 1))
Me
.TextBox7.Text =
CInt
(Int((100 * Rnd()) + 1))
End
Sub
Si quelqu'un peut m'aider, se serrait gentil.
Merci.