
estoy intentando hacer un programa que me convierta una frase en otra. algo así como un algoritmo de criptografia muy simple.
he conseguido hacerlo si el usuario va escribiendo en el cuadro de texto, pero si hace copiar y pegar (cosa útil cuando se trate de hacer la operación inversa) entonces no tira.
Código:
Option Explicit
Dim matriz(3000) As Byte
Dim i As Integer
Private Sub cmdSubmit_Click()
Dim f As Integer
Cls
For f = 0 To i
txt2.Text = Chr(matriz(f)) & txt2.Text
Next
i = 0
End Sub
Private Sub txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then 'si backspace, entonces intro
KeyAscii = 13
End If
i = i + 1
matriz(i) = KeyAscii
If KeyAscii = 13 Then 'si intro, entonces click
cmdSubmit_Click
End If
End Sub
Dim matriz(3000) As Byte
Dim i As Integer
Private Sub cmdSubmit_Click()
Dim f As Integer
Cls
For f = 0 To i
txt2.Text = Chr(matriz(f)) & txt2.Text
Next
i = 0
End Sub
Private Sub txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then 'si backspace, entonces intro
KeyAscii = 13
End If
i = i + 1
matriz(i) = KeyAscii
If KeyAscii = 13 Then 'si intro, entonces click
cmdSubmit_Click
End If
End Sub
alguna idea?










Autor



En línea


