Affichage de zone de texte

Résolu/Fermé
abdellah_tadjine Messages postés 191 Date d'inscription jeudi 30 novembre 2006 Statut Membre Dernière intervention 5 janvier 2022 - 22 oct. 2018 à 21:07
pijaku Messages postés 12263 Date d'inscription jeudi 15 mai 2008 Statut Modérateur Dernière intervention 4 janvier 2024 - 23 oct. 2018 à 13:37
slt, dans mon userform j'ai plusieurs texte box que je dois remplir en fonction de mes donnés; et les laisser vide ne me plait pas ; ce que je souhaite faire et que a chaque remplissage d'une textbox je click sur le bouton VALIDER; et le textbox suivant s'affiche automatiquement.
trés cordialement ABDELLAH

3 réponses

f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 1 701
23 oct. 2018 à 07:56
Bonjour,

Certes certes, pouvez vous mettre votre fichier a dispo
sur ce site par exemple: https://mon-partage.fr/
Pas de donnees confidentielles, mais des donnees quand meme
0
pijaku Messages postés 12263 Date d'inscription jeudi 15 mai 2008 Statut Modérateur Dernière intervention 4 janvier 2024 2 743
23 oct. 2018 à 09:50
Bonjour,

a chaque remplissage d'une textbox je click sur le bouton VALIDER
Tu parles d'une ergonomie...

Cela concerne combien de TextBox?
Est-ce que cela concerne tous les TextBox de ton UserForm ou seulement certains?
0
abdellah_tadjine Messages postés 191 Date d'inscription jeudi 30 novembre 2006 Statut Membre Dernière intervention 5 janvier 2022 6
23 oct. 2018 à 12:04
merci,
non certains TextBox , pas tous
0
pijaku Messages postés 12263 Date d'inscription jeudi 15 mai 2008 Statut Modérateur Dernière intervention 4 janvier 2024 2 743
23 oct. 2018 à 13:37
Un exemple à adapter et tester :

Option Explicit

Private TxtSpec
Private Indice As Integer
Private NoEvents As Boolean

Private Sub UserForm_Activate()
Dim T
   TxtSpec = Array(TextBox1, TextBox3, TextBox5, TextBox7, TextBox9) 'liste des textbox à cacher
   Indice = -1
   For Each T In TxtSpec
      T.Visible = False
   Next T
   AuSuivant 'On affiche le premier des textboxes cachés et on lui donne le focus
   NoEvents = True
End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
   If NoEvents Then AuSuivant
End Sub

Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
   If NoEvents Then AuSuivant
End Sub

Private Sub TextBox5_Exit(ByVal Cancel As MSForms.ReturnBoolean)
   If NoEvents Then AuSuivant
End Sub

Private Sub TextBox7_Exit(ByVal Cancel As MSForms.ReturnBoolean)
   If NoEvents Then AuSuivant
End Sub

Private Sub TextBox9_Exit(ByVal Cancel As MSForms.ReturnBoolean)
   If NoEvents Then AuSuivant
End Sub

Private Sub AuSuivant()
'Affiche le TextBox masqué et lui donne le focus
   NoEvents = False
   If Indice < UBound(TxtSpec) Then
      Indice = Indice + 1
      With TxtSpec(Indice)
         .Visible = True
         .SetFocus
      End With
   End If
   NoEvents = True
End Sub

0