Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "1" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 3 TextBox4.Text = TextBox4.Text + 1 TextBox5.Text = TextBox5.Text + 2 Label2.Text = "Âmes vertes utilsé:" End If If TextBox1.Text = "2" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 5 TextBox4.Text = TextBox4.Text + 3 TextBox5.Text = TextBox5.Text + 4 Label2.Text = "Âmes vertes utilsé:" End If If TextBox1.Text = "3" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 8 TextBox4.Text = TextBox4.Text + 5 TextBox5.Text = TextBox5.Text + 6 Label2.Text = "Âmes vertes utilsé:" End If If TextBox1.Text = "4" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 10 TextBox4.Text = TextBox4.Text + 7 TextBox5.Text = TextBox5.Text + 8 Label2.Text = "Âmes vertes utilsé:" End If If TextBox1.Text = "5" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 15 TextBox4.Text = TextBox4.Text + 10 TextBox5.Text = TextBox5.Text + 10 Label2.Text = "Âmes vertes utilsé:" End If If TextBox1.Text = "6" Then TextBox2.Text = TextBox2.Text + 500000 TextBox3.Text = TextBox3.Text + 20 TextBox4.Text = TextBox4.Text + 12 TextBox5.Text = TextBox5.Text + 1 Label2.Text = "Âmes rouges utilsé:" End If If TextBox1.Text = "7" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 25 TextBox4.Text = TextBox4.Text + 14 TextBox5.Text = TextBox5.Text + 2 Label2.Text = "Âmes rouges utilsé:" End If If TextBox1.Text = "8" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 30 TextBox4.Text = TextBox4.Text + 16 TextBox5.Text = TextBox5.Text + 3 Label2.Text = "Âmes rouges utilsé:" End If If TextBox1.Text = "9" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 35 TextBox4.Text = TextBox4.Text + 18 TextBox5.Text = TextBox5.Text + 4 Label2.Text = "Âmes rouges utilsé:" End If If TextBox1.Text = "10" Then TextBox2.Text = TextBox2.Text + 200000 TextBox3.Text = TextBox3.Text + 40 TextBox4.Text = TextBox4.Text + 20 TextBox5.Text = TextBox5.Text + 5 Label2.Text = "Âmes rouges utilsé:" End If If TextBox1.Text = "11" Then TextBox2.Text = TextBox2.Text + 1000000 TextBox3.Text = TextBox3.Text + 45 TextBox4.Text = TextBox4.Text + 22 TextBox5.Text = TextBox5.Text + 1 Label2.Text = "Âmes pures utilsé:" End If If TextBox1.Text = "12" Then TextBox2.Text = TextBox2.Text + 1000000 TextBox3.Text = TextBox3.Text + 50 TextBox4.Text = TextBox4.Text + 24 TextBox5.Text = TextBox5.Text + 2 Label2.Text = "Âmes pures utilsé:" End If If TextBox1.Text = "13" Then TextBox2.Text = TextBox2.Text + 1000000 TextBox3.Text = TextBox3.Text + 55 TextBox4.Text = TextBox4.Text + 26 TextBox5.Text = TextBox5.Text + 3 Label2.Text = "Âmes pures utilsé:" End If If TextBox1.Text = "14" Then TextBox2.Text = TextBox2.Text + 1000000 TextBox3.Text = TextBox3.Text + 60 TextBox4.Text = TextBox4.Text + 28 TextBox5.Text = TextBox5.Text + 4 Label2.Text = "Âmes pures utilsé:" End If If TextBox1.Text = "15" Then TextBox2.Text = TextBox2.Text + 1000000 TextBox3.Text = TextBox3.Text + 70 TextBox4.Text = TextBox4.Text + 30 TextBox5.Text = TextBox5.Text + 5 Label2.Text = "Âmes pures utilsé:" End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "0" TextBox3.Text = "0" TextBox4.Text = "0" TextBox5.Text = "0" End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged TextBox2.Text = "0" TextBox3.Text = "0" TextBox4.Text = "0" TextBox5.Text = "0" End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionj'ai 80% de chance de ouvir la form2
Enfête c'est pour générer un truc
2 = 75%
3 = 70%
4 = 60%
...
15 = 1%
Pour faire ce que tu dis vouloir faire (tirer aléatoirement avec un pourcentage de réussite parmi plusieurs objets) il te faut tirer aléatoirement un index dans un tableau dynamique où chaque objet est représenté autant de fois qu'il a de chances d'être tiré .non ca me dit rien ^^.
Ca te dit quelque chose, j'espère !
If ComboBox1.Text"1" Then '80% de chance d'ouvrir form2 < Me faut se code End if
Et à propos de fête, j'ai bien l'impression de ce qu'elle a commencé ici :
2 = 75%
3 = 70%
4 = 60%
...
15 = 1%
Excellent !
Je vais mentionner, en prévision des prochaines élections présidentielles, celle possibilité inattendue, dès le 1er tour . On va bien voir la tête qu'ils vont faire, à la commission électorale, en découvrant qu'ils n'avaient pas prévu un tel coup
1 = 80%
2 = 75%
3 =70%
4 =60%
5 =50%
6=40%
7=35%
8=30%
9=25%
10=20%
11=10%
12=7%
13=5%
14=3%
15=1%