Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/11/2007, 02:13
Insomnia
 
Fecha de Ingreso: noviembre-2005
Mensajes: 751
Antigüedad: 18 años, 6 meses
Puntos: 13
Re: Ayuda insertar texto en richtextbox

Hola

Sería algo como esto:
Código:
Dim ntexto As String
    ntexto = Left(RText.Text, RText.SelStart)
    ntexto = ntexto & "textoinsertado"
    ntexto = ntexto & Mid(RText.Text, RText.SelStart, Len(RText.Text) - RText.SelStart)
    RText.Text = ntexto
Donde RText es el RichTextBox y ntexto una variable de tipo String, con SelStart detecto la posición en la que se encuentra el cursor, y meto la primera parte en la variable, luego agrego el texto que me interesa y finalmente cojo la parte derecha del texto original.

--Saludos--