Programmation Msgbox si Caption = X
napster94700
Messages postés
76
Date d'inscription
Statut
Membre
Dernière intervention
-
jjsteing Messages postés 1670 Date d'inscription Statut Contributeur Dernière intervention -
jjsteing Messages postés 1670 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour, j'aurais voulu avoir votre aide pour cette commande.
Je n'arrive pas a faire en sorte que qu'une fenêtre s'ouvre si les 3 premiers boutons sont cochés.
J'ai 3 buttons et 2 CheckBox
Si je coche la première CheckBox cela va me mettre un X sur le ou les boutons que je clic
Et je veux qu'une fois avoir cliquer sur les 3 boutons donc rempli de X j'ai une fenetre qu'il souvre
If bt1.Caption = "X" And bt2.Caption = "X" And bt3.Caption = "X" Then MsgBox "X Gagne"
La sa ne met rien mais la fenetre ne s'ouvre pas
La sa met une erreur
If bt1.valeur = Check1.Text And bt2.valeur = Check1.Text Then MsgBox "ok"
Concretement je veux dire:
If les 3 boutons ont pour caption "X" alors mettre fenetre.
Merci
Je n'arrive pas a faire en sorte que qu'une fenêtre s'ouvre si les 3 premiers boutons sont cochés.
J'ai 3 buttons et 2 CheckBox
Si je coche la première CheckBox cela va me mettre un X sur le ou les boutons que je clic
Et je veux qu'une fois avoir cliquer sur les 3 boutons donc rempli de X j'ai une fenetre qu'il souvre
If bt1.Caption = "X" And bt2.Caption = "X" And bt3.Caption = "X" Then MsgBox "X Gagne"
La sa ne met rien mais la fenetre ne s'ouvre pas
La sa met une erreur
If bt1.valeur = Check1.Text And bt2.valeur = Check1.Text Then MsgBox "ok"
Concretement je veux dire:
If les 3 boutons ont pour caption "X" alors mettre fenetre.
Merci
A voir également:
- Programmation Msgbox si Caption = X
- Site x - Guide
- Sites X : Pornhub, YouPorn et Redtube sont de nouveau accessibles en France - Guide
- Photoscape x - Télécharger - Retouche d'image
- Direct x - Télécharger - Pilotes & Matériel
- Sit x - Accueil - Protection
49 réponses
jjsteing
Messages postés
1670
Date d'inscription
Statut
Contributeur
Dernière intervention
181
et a part par honomatopé... c'est un oui??
ok, j ai vu ton code...
bon, normal.. un copier coller 9 fois sur chaque boutons.. classique :)
2 choses qui rendront ton code beaucoup plus simple.. l'indexage des boutons et enlever tes coches
apres on verra comment lui faire trouver si "X" ou "O" sont alignés, pour ca tu va pleurer un peu pour comprendre, mais c'est normal et t'en trouvera beaucoup plus.. comment dire.. ravi :)
donc l'indexage des boutons cf post 16
https://forums.commentcamarche.net/forum/affich-13554873-programmation-msgbox-si-caption-x#16
dis moi si tu as tout compris :)
bon, normal.. un copier coller 9 fois sur chaque boutons.. classique :)
2 choses qui rendront ton code beaucoup plus simple.. l'indexage des boutons et enlever tes coches
apres on verra comment lui faire trouver si "X" ou "O" sont alignés, pour ca tu va pleurer un peu pour comprendre, mais c'est normal et t'en trouvera beaucoup plus.. comment dire.. ravi :)
donc l'indexage des boutons cf post 16
https://forums.commentcamarche.net/forum/affich-13554873-programmation-msgbox-si-caption-x#16
dis moi si tu as tout compris :)
Oui j'ai compris le system
mais tu n'aurais pas un bout de code comme exemple
En gros tu ne travaille en quelque sorte le code que dans "1" boutton en présisent () les bouttons souhaités
mais tu n'aurais pas un bout de code comme exemple
En gros tu ne travaille en quelque sorte le code que dans "1" boutton en présisent () les bouttons souhaités
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Ouais je comprend le system mais par exemple la pour le morpion je dois faire
J'ai 9 bouttons indexés
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 Then Caption = "X"
If Check2.Value = 1 Then Caption = "O"
End Sub
avant le caption fo bien ke je mete
Command1(1)
Command1(2)
Command1(3)
J'ai 9 bouttons indexés
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 Then Caption = "X"
If Check2.Value = 1 Then Caption = "O"
End Sub
avant le caption fo bien ke je mete
Command1(1)
Command1(2)
Command1(3)
J'ai trouver il fallait rajouter une autre condition sa donnerait sa a peut pres ?
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "X"
If Check2.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "O"
If Check1.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "X"
If Check2.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "O"
If Check1.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "X"
If Check2.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "O"
If Check1.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "X"
If Check2.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "O"
If Check1.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "X"
If Check2.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "O"
If Check1.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "X"
If Check2.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "O"
If Check1.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "X"
If Check2.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "O"
If Check1.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "X"
If Check2.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "O"
If Check1.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "X"
If Check2.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "O"
End Sub
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "X"
If Check2.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "O"
If Check1.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "X"
If Check2.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "O"
If Check1.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "X"
If Check2.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "O"
If Check1.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "X"
If Check2.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "O"
If Check1.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "X"
If Check2.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "O"
If Check1.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "X"
If Check2.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "O"
If Check1.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "X"
If Check2.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "O"
If Check1.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "X"
If Check2.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "O"
If Check1.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "X"
If Check2.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "O"
End Sub
et ca c'est pas mieux ?
If Check1.Value = 1 Then Command1(index).Caption = "X"
If Check2.Value = 1 Then Command1(index).Caption = "O"
:D
?
If Check1.Value = 1 Then Command1(index).Caption = "X"
If Check2.Value = 1 Then Command1(index).Caption = "O"
:D
?
Ahhhhh tu m'énerve t trop fort mdrrrrr
Bon j'ai essayer de le faire avant de lire ta réponce donc je te donne quand meme sa ^^
Private Sub btReset_Click()
End Sub
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "X"
If Check2.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "O"
If Check1.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "X"
If Check2.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "O"
If Check1.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "X"
If Check2.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "O"
If Check1.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "X"
If Check2.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "O"
If Check1.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "X"
If Check2.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "O"
If Check1.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "X"
If Check2.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "O"
If Check1.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "X"
If Check2.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "O"
If Check1.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "X"
If Check2.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "O"
If Check1.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "X"
If Check2.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "O"
If Command1(1).Caption = "X" And Command1(2).Caption = "X" And Command1(3).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(4).Caption = "X" And Command1(5).Caption = "X" And Command1(6).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(7).Caption = "X" And Command1(8).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(4).Caption = "X" And Command1(7).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(2).Caption = "X" And Command1(5).Caption = "X" And Command1(8).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(3).Caption = "X" And Command1(6).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(5).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "O" And Command1(2).Caption = "O" And Command1(3).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(4).Caption = "O" And Command1(5).Caption = "O" And Command1(6).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(7).Caption = "O" And Command1(8).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(4).Caption = "O" And Command1(7).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(2).Caption = "O" And Command1(5).Caption = "O" And Command1(8).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(3).Caption = "O" And Command1(6).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(5).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
End Sub
Bon j'ai essayer de le faire avant de lire ta réponce donc je te donne quand meme sa ^^
Private Sub btReset_Click()
End Sub
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "X"
If Check2.Value = 1 And Command1(1).Value = True Then Command1(1).Caption = "O"
If Check1.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "X"
If Check2.Value = 1 And Command1(2).Value = True Then Command1(2).Caption = "O"
If Check1.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "X"
If Check2.Value = 1 And Command1(3).Value = True Then Command1(3).Caption = "O"
If Check1.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "X"
If Check2.Value = 1 And Command1(4).Value = True Then Command1(4).Caption = "O"
If Check1.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "X"
If Check2.Value = 1 And Command1(5).Value = True Then Command1(5).Caption = "O"
If Check1.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "X"
If Check2.Value = 1 And Command1(6).Value = True Then Command1(6).Caption = "O"
If Check1.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "X"
If Check2.Value = 1 And Command1(7).Value = True Then Command1(7).Caption = "O"
If Check1.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "X"
If Check2.Value = 1 And Command1(8).Value = True Then Command1(8).Caption = "O"
If Check1.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "X"
If Check2.Value = 1 And Command1(9).Value = True Then Command1(9).Caption = "O"
If Command1(1).Caption = "X" And Command1(2).Caption = "X" And Command1(3).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(4).Caption = "X" And Command1(5).Caption = "X" And Command1(6).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(7).Caption = "X" And Command1(8).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(4).Caption = "X" And Command1(7).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(2).Caption = "X" And Command1(5).Caption = "X" And Command1(8).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(3).Caption = "X" And Command1(6).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(5).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "O" And Command1(2).Caption = "O" And Command1(3).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(4).Caption = "O" And Command1(5).Caption = "O" And Command1(6).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(7).Caption = "O" And Command1(8).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(4).Caption = "O" And Command1(7).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(2).Caption = "O" And Command1(5).Caption = "O" And Command1(8).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(3).Caption = "O" And Command1(6).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(5).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
End Sub
là est tout l interet de l'index... c'est de se référencer au numéro du bouton tout en ayant le meme code pour tous les boutons ;)
Ce qui nous donne ^^
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 Then Command1(Index).Caption = "X"
If Check2.Value = 1 Then Command1(Index).Caption = "O"
If Command1(1).Caption = "X" And Command1(2).Caption = "X" And Command1(3).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(4).Caption = "X" And Command1(5).Caption = "X" And Command1(6).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(7).Caption = "X" And Command1(8).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(4).Caption = "X" And Command1(7).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(2).Caption = "X" And Command1(5).Caption = "X" And Command1(8).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(3).Caption = "X" And Command1(6).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(5).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "O" And Command1(2).Caption = "O" And Command1(3).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(4).Caption = "O" And Command1(5).Caption = "O" And Command1(6).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(7).Caption = "O" And Command1(8).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(4).Caption = "O" And Command1(7).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(2).Caption = "O" And Command1(5).Caption = "O" And Command1(8).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(3).Caption = "O" And Command1(6).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(5).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
End Sub
Private Sub Command1_Click(Index As Integer)
If Check1.Value = 1 Then Command1(Index).Caption = "X"
If Check2.Value = 1 Then Command1(Index).Caption = "O"
If Command1(1).Caption = "X" And Command1(2).Caption = "X" And Command1(3).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(4).Caption = "X" And Command1(5).Caption = "X" And Command1(6).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(7).Caption = "X" And Command1(8).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(4).Caption = "X" And Command1(7).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(2).Caption = "X" And Command1(5).Caption = "X" And Command1(8).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(3).Caption = "X" And Command1(6).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "X" And Command1(5).Caption = "X" And Command1(9).Caption = "X" Then
MsgBox "X Gagne"
End If
If Command1(1).Caption = "O" And Command1(2).Caption = "O" And Command1(3).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(4).Caption = "O" And Command1(5).Caption = "O" And Command1(6).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(7).Caption = "O" And Command1(8).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(4).Caption = "O" And Command1(7).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(2).Caption = "O" And Command1(5).Caption = "O" And Command1(8).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(3).Caption = "O" And Command1(6).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
If Command1(1).Caption = "O" And Command1(5).Caption = "O" And Command1(9).Caption = "O" Then
MsgBox "O Gagne"
End If
End Sub
bon.. maintenant on va s'attaquer à ton X ou O...
1) on n'utilise plus ta coche.. si "X" vient de jouer, ca sera forcement le tour de "O" et inversement... jusque là tu me suis..
donc on cré une variable générale CarEnCours :
dans général déclaration (c'est a dire en premire ligne de code, avant toutes les sub :
Dim CarEnCours
on l initialise dans Form_Load avec CarEnCours ="X"
Pour que le bouton prenne la marque voulu on a dans command_click :
If BtJeu(Index).Caption <> "" Then Exit Sub 'ceci si il clique sur un bouton ayant dejà une marque
BtJeu(Index).Caption = CarEnCours 'pour mettre "X" ou "O"
et pour faire l inversion dans ton command1_click(Index as integer) à la fin, juste avant le end sub, ajoute ceci:
If CarEnCours = "X" Then CarEnCours = "O" Else CarEnCours = "X"
end sub
je le met à la fin, car c'est une fois que lon aura verifier si le joueur à gané qu'il faut changer de signe..
1) on n'utilise plus ta coche.. si "X" vient de jouer, ca sera forcement le tour de "O" et inversement... jusque là tu me suis..
donc on cré une variable générale CarEnCours :
dans général déclaration (c'est a dire en premire ligne de code, avant toutes les sub :
Dim CarEnCours
on l initialise dans Form_Load avec CarEnCours ="X"
Pour que le bouton prenne la marque voulu on a dans command_click :
If BtJeu(Index).Caption <> "" Then Exit Sub 'ceci si il clique sur un bouton ayant dejà une marque
BtJeu(Index).Caption = CarEnCours 'pour mettre "X" ou "O"
et pour faire l inversion dans ton command1_click(Index as integer) à la fin, juste avant le end sub, ajoute ceci:
If CarEnCours = "X" Then CarEnCours = "O" Else CarEnCours = "X"
end sub
je le met à la fin, car c'est une fois que lon aura verifier si le joueur à gané qu'il faut changer de signe..
Alors attend que je comprenne bien ce que je fais
Dim CarEnCours
Dim sa veut dire quoi concrètement on demande quoi au programme sa cré une variable c'est sa ?
on l initialise dans Form_Load avec CarEnCours ="X"
La sa va faire quoi au juste ?
Form c'est la fenetre ?
If Command1(Index).Caption <> ""
<> c'est quoi ? ni plus grand ni plus petit que " " ?
Dsl c'est juste pour bien tout maitriser sur sa et pouvoir le réutiliser quand j'en aurais besoin sur d'autre trucs par exemple :)
Dim CarEnCours
Dim sa veut dire quoi concrètement on demande quoi au programme sa cré une variable c'est sa ?
on l initialise dans Form_Load avec CarEnCours ="X"
La sa va faire quoi au juste ?
Form c'est la fenetre ?
If Command1(Index).Caption <> ""
<> c'est quoi ? ni plus grand ni plus petit que " " ?
Dsl c'est juste pour bien tout maitriser sur sa et pouvoir le réutiliser quand j'en aurais besoin sur d'autre trucs par exemple :)
Dim sert à déclarer une variable
Form_Load avec CarEnCours ="X"
=> Form load est une des premiere instruction appelé au démarage du programme. litéralement au chargement de la feuille
If Command1(Index).Caption <> ""
<> veut dire différent en vb
Form_Load avec CarEnCours ="X"
=> Form load est une des premiere instruction appelé au démarage du programme. litéralement au chargement de la feuille
If Command1(Index).Caption <> ""
<> veut dire différent en vb
Ok merci j'ai compris encore quelques questions :p dsl
If Command1(Index).Caption <> "" Then Exit Sub
La je vois pas trop
si la caption des bouttons est différent de rien donc qu'il y a deja x ou o alors
exit sub ?
If Command1(Index).Caption <> "" Then Exit Sub
La je vois pas trop
si la caption des bouttons est différent de rien donc qu'il y a deja x ou o alors
exit sub ?
ben si y a deja un "X" ou "O".. l'utilisateur joue sur une case deja utilisée.. donc ne joue pas.. d où le exit sub
ca veut dire qu il quitte la sub en cours.. comme s'il allait directyement au en sub de la fin du command_click
Okok et j'ai encore un ptit soucis niveau code :p
Le match nul je pensais faire un truc comme sa :
If Command1(Index).Caption <> "" And Command1(Index).Value = True Then MsgBox "Match Nul"
Genre si toutes les cases sont cochées et que leurs caption est forcément différent de "" alors mettre une msgbox je ne sais pas si c'est possible
Le match nul je pensais faire un truc comme sa :
If Command1(Index).Caption <> "" And Command1(Index).Value = True Then MsgBox "Match Nul"
Genre si toutes les cases sont cochées et que leurs caption est forcément différent de "" alors mettre une msgbox je ne sais pas si c'est possible
non, pas exactement.. mais ton resonnement est bon...
Le hic je pense que tu n a pas compris l'indexage...
index dans command(index) correspond au bouton que le joueur à cliquer.. et non tous les boutons
Le hic je pense que tu n a pas compris l'indexage...
index dans command(index) correspond au bouton que le joueur à cliquer.. et non tous les boutons
Ah ok !!!
Donc
If Command1(1).Caption <> "" And Command1(2).Caption <> "" And Command1(3).Caption <> "" And Command1(4).Caption <> "" And Command1(5).Caption <> "" And Command1(6).Caption <> "" And Command1(7).Caption <> "" And Command1(8).Caption <> "" And Command1(9).Caption <> "" Then
MsgBox "Match Nul"
Donc
If Command1(1).Caption <> "" And Command1(2).Caption <> "" And Command1(3).Caption <> "" And Command1(4).Caption <> "" And Command1(5).Caption <> "" And Command1(6).Caption <> "" And Command1(7).Caption <> "" And Command1(8).Caption <> "" And Command1(9).Caption <> "" Then
MsgBox "Match Nul"