Avec la propriété MaxLength de Text1 égale à 1 ... Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then If Text1.Text <> "" Then Label1.Caption = Asc(Text1.Text) End If End If End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionIf KeyAscii = 13 And Text1.Text <> "" Then Label1.Caption = Asc(Text1.Text) Text1 = "" Text2.SetFocus ' A = Chr(Text1.Text) ' Print A End If