Tema: limpiar text
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/03/2008, 16:25
Avatar de apofis
apofis
 
Fecha de Ingreso: enero-2008
Ubicación: españa
Mensajes: 77
Antigüedad: 16 años, 4 meses
Puntos: 1
limpiar text

no logro limpiar el text despues de pulsar el siguiente boton,me explico:

tengo un text en el cual al pulsar un boton aparece el contenido de un archivo de texto y asi sucesivamente con tres botones y diferentes textos y el problema es que cuando pulso el segundo boton quiero limpiar lo que salio anteriormente y que aparezca el nuevo texto,asi con los tres botones y no lo consigo.

e probado con esto:
Dim text As Object
For Each text In Controls
If TypeOf text Is TextBox Then text.text = ""
Next


les dejo el codigo:

Option Explicit
Dim cam As String
Dim reproductor As String
Dim acercade As String
Dim renglon As String

Private Sub Command1_Click()
renglon = Chr(13) & Chr(10)
Open App.Path & "\cam.txt" For Input As #1
While Not EOF(1)
Line Input #1, cam$
Text1.text = Text1.text & cam & renglon
Wend
Close #1
End Sub


Private Sub Command2_Click()
renglon = Chr(13) & Chr(10)
Open App.Path & "\reproductor.txt" For Input As #1
While Not EOF(1)
Line Input #1, reproductor$
Text1.text = Text1.text & reproductor & renglon
Wend
Close #1
End Sub

Private Sub Command3_Click()
renglon = Chr(13) & Chr(10)
Open App.Path & "\acercade.txt" For Input As #1
While Not EOF(1)
Line Input #1, acercade$
Text1.text = Text1.text & acercade & renglon
Wend
Close #1
End Sub