ok. i have gotten this code:
vb Code:
Private Sub HighlightL(Find As String, Color As OLE_COLOR, MainColor As OLE_COLOR) Dim i As Long Dim txtBox As String Dim intTxtLen As Integer Dim intLength As Integer Dim intPos As Integer Dim blnFound As Boolean Dim iTemp As Long intPos = txtLoad.SelStart intLength = Len(Find) txtBox = txtLoad.Text On Error Resume Next intTxtLen = Len(txtLoad.Text) With txtLoad For i = 0 To intTxtLen intPos = .SelStart If .Find(Find, i, i + intLength) = Find Then .Find Find, i, i + intLength .SelColor = Color .SelStart = intPos .SelLength = 0 .SelColor = MainColor End If Next End With End Sub
and it works exactly how i want... one problem.. large files = very very slow. any help on speeding this up?




Reply With Quote