Encriptado

Form

Private Sub Command1_Click() UserControl11.desencrip End Sub Private Sub Command2_Click() UserControl11.LIMPIAR End Sub

User Control

Public vvalor As Integer Public Function LIMPIAR() Text1.Text = "" End Function Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii >= 65 And KeyAscii <= 90 Then KeyAscii = KeyAscii + valorcorrido Else If KeyAscii <> 8 Then KeyAscii = 0 End If End If End Sub Private Sub UserControl_Initialize() Call UserControl_Resize End Sub Private Sub UserControl_Resize() Text1.Top = 0 Text1.Left = 0 Text1.Height = UserControl.Height Text1.Width = UserControl.Width End Sub Property Let valorcorrido(xxx As Integer) vvalor = xxx PropertyChanged valorcorrido End Property Property Get valorcorrido() As Integer valorcorrido = vvalor End Property Public Function desencrip() '(texto As String) For i = 1 To Len(Text1.Text) letra = Mid(Text1.Text, i, 1) codigo = Asc(letra) - valorcorrido nuevotext = nuevotext & Chr(codigo) Next i Text1.Text = nuevotext End Function Private Sub UserControl_ReadProperties(PropBag As PropertyBag) vvalor = PropBag.ReadProperty("valorcorrido", 0) End Sub Private Sub UserControl_WriteProperties(PropBag As PropertyBag) Call PropBag.WriteProperty("valorcorrido", vvalor, 0) End Sub