Quand on fait entré imiter tab

Résolu
thetoto52 Messages postés 87 Date d'inscription lundi 9 janvier 2006 Statut Membre Dernière intervention 11 novembre 2008 - 24 janv. 2006 à 10:51
gallyhc Messages postés 386 Date d'inscription samedi 4 octobre 2008 Statut Membre Dernière intervention 19 février 2018 - 24 janv. 2006 à 14:27
voila je voudrais pouvaoir passer d'une text box a l'autre lorsqu'on apuie sur la touche entré comme le fait la touche tab en fait

merci d'avance

3 réponses

gallyhc Messages postés 386 Date d'inscription samedi 4 octobre 2008 Statut Membre Dernière intervention 19 février 2018 2
24 janv. 2006 à 11:56
Bonjour,

Tu crées une collection de textbox (le nom pour ce code est text1), apres dans la fonction "Private Sub Text1_KeyPress", tu copies le code ci-dessous et voila a chanque entre il passe au textbox suivant.

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
' CHANGEMENT D'UN TEXTBOX A UN AUTRE.
If KeyAscii = &HD Then
If Index > Text1.Count - &H2 Then
Index = -&H1
End If
Text1(Index + &H1).SetFocus
End If


End Sub

A++
[Gally Home Corp]
3
thetoto52 Messages postés 87 Date d'inscription lundi 9 janvier 2006 Statut Membre Dernière intervention 11 novembre 2008
24 janv. 2006 à 13:55
ok merci pour la solution
0
gallyhc Messages postés 386 Date d'inscription samedi 4 octobre 2008 Statut Membre Dernière intervention 19 février 2018 2
24 janv. 2006 à 14:27
Re,

Pas de quoi si celle-ci te va moi aussi ;-). Je pense que c'est la solution la plus simple avec l'utilisation des collections

Bonne programmation,
[Gally Home Corp]
0
Rejoignez-nous