
13/09/2009, 08:01
|
 | | | Fecha de Ingreso: julio-2006 Ubicación: Órbita sincrónica
Mensajes: 899
Antigüedad: 18 años, 8 meses Puntos: 29 | |
Respuesta: Como saber cuando se paso por un salto de linea RichTextBox? Me aburría y la he modificado para usar el RichTextBox.Find
Private Sub BuscaTexto(ByVal TextoABuscar As String, TextBox As RichTextBox)
Dim PosicionTexto As Double
If TextBox.SelStart >= Len(TextBox.text) Then Exit Sub
If TextBox.SelStart = 0 And Left$(TextBox.Text, Len(TextoABuscar)) = TextoABuscar And TextBox.SelText <> TextoABuscar Then
TextBox.SelLength = Len(TextoABuscar)
Exit Sub
End If
PosicionTexto = TextBox.Find(TextoABuscar, TextBox.SelStart + TextBox.SelLength)
If PosicionTexto > 0 then
TextBox.SelStart = PosicionTexto
TextBox.SelLength = Len(TextoABuscar)
End If
End Sub
Y así parece funcionar bien
Saludos
Última edición por pkj; 13/09/2009 a las 09:12 |