Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/03/2009, 12:14
Avatar de David
David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Respuesta: Guardar renglon de un TextBox multiline si se encuentra determinado texto

Podría ser algo como esto:
Código vb:
Ver original
  1. Dim Position As Integer
  2. Dim Texto As String
  3. Texto = Text1.Text & vbCrLf
  4. Position = InStr(Texto, "harry potter")
  5. Texto = Left(Texto, InStr(Position, Texto, vbCrLf) - 1)
  6. Texto = Right(Texto, Len(Texto) - InStrRev(Texto, vbCrLf) - 1)
  7. MsgBox Texto
Debes investigar un poco sobre las funciones para manejar texto para estos casos, Left, Right, Mid, InStr, InStrRev, etc.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.