Hi ,
I wanted to know if there is a way to change text properties of the
node(x).text in a tree view,
For example I have the following code that searches a tree for a string,
and the appends *** before and after
the found string. What I would like to do is instead of placing *** I would
like to highlight or change color or underline the text, Can this be Done ?
Private Sub Tree_Search(target As String, ByRef location As Integer)
On Error GoTo errhand
Dim X As Integer
Dim hitcnt As Integer
hitcnt = 0
For X = location To tvDossier.Nodes.count
If InStr(UCase(tvDossier.Nodes(X).Text), UCase(target)) > 0 Then
tvDossier.Nodes(X).EnsureVisible
tvDossier.Nodes(X).Selected = True
' this is where I need to change text properties!!
tvDossier.Nodes(X).Text = "***" & tvDossier.Nodes(X).Text &
"***"
location = X + 1
hitcnt = hitcnt + 1
Command1(2).Caption = "Find Next"
Exit For
End If
Next X
If hitcnt = 0 Then
MsgBox "No Matches Found"
Command1(2).Caption = "Search"
location = 0
End If
Exit Sub