Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionQuel type d'"alignement" ? visuel ou "logique" ? en quel(s) sens ?
Button1=1 Button2=21 Button3=212 Button4=1212
Button1.Text.IndexOf(0) "1" And Button2.Text.IndexOf(1) "1" And Button3.Text.IndexOf(2) = "1" And Button4.Text.IndexOf(3) = "1"
If Button1.Text.Contains("1111") Or _ Button2.Text.Contains("1111") Or _ Button3.Text.Contains("1111") Or _ Button4.Text.Contains("1111") Or _ Button5.Text.Contains("1111") Or _ Button6.Text.Contains("1111") Or _ Button7.Text.Contains("1111") Or _ Button1.Text.First.ToString "1" And Button2.Text.ToString "1" And Button3.Text.ToString = "1" And Button4.Text.ToString = "1" Or _ Button2.Text.First.ToString "1" And Button3.Text.ToString "1" And Button4.Text.ToString = "1" And Button5.Text.ToString = "1" Or _ Button3.Text.First.ToString "1" And Button4.Text.ToString "1" And Button5.Text.ToString = "1" And Button6.Text.ToString = "1" Or _ Button4.Text.First.ToString "1" And Button5.Text.ToString "1" And Button6.Text.ToString = "1" And Button7.Text.ToString = "1" Then '... End if
A vrai dire... disons que quand ces numéros s'ajoutent dans le bouton, d'autres actions sont faites (donc pas besoin de formatage/police adéquat, c'est juste des repère.)*
Je désirerai afficher une messagebox si un de mes 4 boutons contient "1111" alignée.
Par exemple :
Button 1 = 1
Button2 = 21
Button3 = 221
Button4 = 2221
Ou bien :
Button1 = 0231
Button2 = 321
Button3 = 21
Button4 = 1
Quand je clique sur un bouton (le bouton1 par exemple), celui-ci ajoute soit un 1 ou soit un 2.
Quand un 1 est ajouter, le prochain numero qui sera ajouté sera un 2.
donc admettons que je clique 1 fois sur le bouton1, 2 fois sur le button2, 3 fois sur le button3, et 4 fois sur le button4.
Cela devrai nous donner :
Button1=1
Button2=21
Button3=212
Button4=1212
If Button1.Text.Contains("1111") Or _
Button2.Text.Contains("1111") Or _
Button3.Text.Contains("1111") Or _
Button4.Text.Contains("1111") Or _
Button5.Text.Contains("1111") Or _
Button6.Text.Contains("1111") Or _
Button7.Text.Contains("1111") Or _