QUESTION !!!

—| N o V a ™ |— - 9 déc. 2000 à 04:25
 Gmi - 10 déc. 2000 à 00:39
QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!! QUESTION !!!

bon la je voudrais savoir comment convertir des caracteres

j'mexplique: Je fais un textbox, si on entre un S dedans, J'aimerais que ca l'écrive un §, si on fais un A que ca fasse @, c: © .... etc etc !!

!!!! HELP ME PLEASE !!!!

3 réponses

Sub Text1_Change

If Text1.Text = "" Then Exit Sub
z$ = Text1.Text

For a = 1 To Len(z$)
t$ = Mid$(z$, a, 1)If UCase$(t$) "A" Then t$ "@"If UCase$(t$) "S" Then t$ "§"If UCase$(t$) "C" Then t$ "©"
Mid$(z$, a, 1) = t$
Next

Text1.Text = z$
Text1.SelStart = Len(Text1.Text)

end Sub

C'est un exemple, comme un autre.

Int19h
0
—| N o V a ™ |—
9 déc. 2000 à 18:41
Coline que tes bon !! lolll merciiiiiiii :)
0
Vous pouvez utiliser l'événement KeyPress associé au TextBox text1.

Private Sub Text1_KeyPress(KeyAscii As Integer)
'Vous pouvez écrire ici le code que
'vous désirez pour pour changer les
'caractères

KeyAscii = 0
End Sub

N.B: Le principe de fonctionnement est
que l'événement KeyPress n'écris pas directement dans le textBox, mais il nous permet d'intercepter la touche pressée, qu'on pourra analyser pour faire tout ce qu'on veux. Bonne Chance.
0
Rejoignez-nous