Ver Mensaje Individual
  #17 (permalink)  
Antiguo 23/04/2008, 06:00
triump
 
Fecha de Ingreso: abril-2008
Mensajes: 33
Antigüedad: 16 años
Puntos: 0
Pregunta Re: Escribir texto en un formulario

Hola amigos David el grande y Avellaneda.

He programado lo siguiente:

Código:
Private Sub Form_KeyPress(KeyAscii As Integer)
    Dim texto As String
    texto = Chr(KeyAscii)
    ' si el texto llega al margen derecho del form, nueva línea
    If Me.CurrentX >= Me.ScaleWidth - 90 Then Me.Print Chr(13)
    Me.Print texto;
End Sub

Private Sub Form_Load()
Close
Open "Prueba.txt" For Binary As #1
TextFile = Input(LOF(1), 1)
Close
Me.Print TextFile
End Sub

Private Sub Form_Unload(Cancel As Integer)
' si no existe Prueba.txt, lo crea y si existe lo sobreescribe
Open App.Path & "\Prueba.txt" For Output As #1
    Print #1, s
Close #1
End Sub
y me guarda los archivos en el directorio de la aplicacion pero sin texto alguno del que escribo. ¿Podeis ayudarme?.