Gracias por respoender Elektro .
en internet encontre este codigo que me busca y subralla la palabra que busco en un RichTextbox .
code que encontre en internet:
Dim TEMPORAL As String = RichTextBox1.Text
RichTextBox1.Clear()
RichTextBox1.Text = TEMPORAL
Try
Dim BUSQUEDA As String = InputBox("BUSCAR")
Dim INDEX As Integer
While INDEX < RichTextBox1.Text.LastIndexOf(BUSQUEDA)
RichTextBox1.Find(BUSQUEDA, INDEX, RichTextBox1.TextLength, RichTextBoxFinds.None)
RichTextBox1.SelectionBackColor = Color.DarkBlue
INDEX = RichTextBox1.Text.IndexOf(BUSQUEDA, INDEX) + 1
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Pero el Tu codigo esta SUPER . pero al intentar abrirlo con mi vb 2010 me salen miles de errores .
bueno pase el code importante a un boton de mi proyecto pero me sale 1 error .
aqui te dejo el code que extraje y puse en mi proyecto.
Dim rtb As RichTextBox = Me.RichTextBox1
' Reset selection.
With rtb
.SelectAll()
.SelectionColor = .ForeColor
.SelectionBackColor = .BackColor
.SelectionFont = .Font
.Select(0, 0)
End With
' Perform a new selection.
Dim find As String = Me.TextBox1.Text ' The text to find.
Dim ignoreCase As Boolean = Me.CheckBox1.Checked
Dim forecolor As Color = Color.LimeGreen
Dim backcolor As Color = rtb.SelectionBackColor
Dim font As Font = rtb.SelectionFont
Dim occurrences As Integer = rtb.ColorizeMatches(find, ignoreCase, forecolor, backcolor, font) ' HE AQUI EL ERROR ME DICE COLORIZEMATCHES NO ES UN MIENBRO DE SYSTEM.WINDOWS.FORM1.WINDOWSAPLICATION10
Me.Label1.Text = String.Format("{0} occurrences", occurrences)
EL ERROR ME DICE COLORIZEMATCHES NO ES UN MIENBRO DE SYSTEM.WINDOWS.FORM1.WINDOWSAPLICATION10