Voir le zip
Télécharger le zip
il vous faudrais toujours changer de nom Ex:. a1 a2 a3...
Ton prog est pas mal mais je amélioré le code:Private Sub cmdstart_Click()Dim intQte As SingleDim nb(3)lblgains2.Visible = Falselblgains.Visible = Falselblgains2.Caption = ""lblgains.Caption = ""Randomize 'random pour le défilement des nombres nb(0) = Int(Rnd * 10) nb(1) = Int(Rnd * 10) nb(2) = Int(Rnd * 10) nb(3) = Int(Rnd * 10)For i = 0 To 3For n = 0 To nb(i) lbl7(i).Caption = nFor j = 0 To 200 DoEvents DoEvents DoEvents DoEvents DoEventsNextNextNext'Calcul du nombre de 7intQte = 0For i = 0 To 3If lbl7(i).Caption = 7 Then intQte = intQte + 1End IfNext'Affichage du montant gagnéIf intQte = 4 Then lblgains.Caption = Format(Val(lblgains.Caption) + 500, "currency") lblgains.Visible = TrueElseIf intQte = 3 Then lblgains.Caption = Format(Val(lblgains.Caption) + 100, "currency") lblgains.Visible = TrueElseIf intQte = 2 Then lblgains.Caption = Format(Val(lblgains.Caption) + 10, "currency") lblgains.Visible = TrueElseIf intQte = 1 Then lblgains.Caption = Format(Val(lblgains.Caption) + 2, "currency") lblgains.Visible = TrueElse lblgains2.Caption = "Vous n'avez rien gagné..." lblgains2.Visible = TrueEnd If'Diminution de 2$ a chaque partielblsolde.Caption = Val(lblsolde.Caption) - 2lblsolde.Caption = Val(lblsolde.Caption) + Val(lblgains.Caption)lblsolde.Caption = Format(lblsolde.Caption, "currency")'Si vous n'avez plus d'argent, vous devez remiser ou partirIf lblsolde.Caption <= 0 Then MsgBox "VOUS N'AVEZ PLUS D'ARGENT, LA BANQUE CONTINUE SON BON TRAVAIL", vbCritical, "Banqueroute" choix = MsgBox("Voulez vous remiser?", vbYesNo, "Remiser?") If choix = vbNo Then End Else txtmise.Enabled = True txtmise.Text = "" txtmise_gotfocus End IfEnd If End Sub
Si tu veux mais moi, je voulais un effet d'attente, comme une vrai machine a boule, ce que j'ai pas avec le tien mais je crois que si on rajoute des DoEvents, on pourrais avoir l'effet rechercher
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte
1 874 404 membres 0 nouveaux aujourd'hui 16 152 membres club