shaunhubbs
Technical User
Hi all,
I am trying to add icons beside nodes in my treeview and am not able to do so with the following code:
Can anyone spot the reason for this not working? The image does definitely exist...
Thanks in advance.
- Shaun
I am trying to add icons beside nodes in my treeview and am not able to do so with the following code:
Code:
Do Until rs.EOF
Dim imgVar As ImageList
Form_frmSetsTree.imlIcons.ImageHeight = 16
Form_frmSetsTree.imlIcons.ImageWidth = 16
[COLOR=red] Set imgVar = Form_frmSetsTree.imlIcons.ListImages.Add _
(1, "Question", LoadPicture("C:\WINDOWS\Help\Tours\htmlTour\question_icon.jpg"))[/color red]
Dim c As Integer 'Child level
c = rs!lvl
Dim p As Integer 'Parent level
p = rs!lvl - 1
' Fill the root level of the tree with set names
If rs!lvl = 1 Then
Form_frmSetsTree!axTreeView.Nodes.Add , , "l1" & rs!urn, RTrim(rs!Child), [COLOR=red]"Question"[/color red]
' Fill with a child node in the tree
Else
Form_frmSetsTree!axTreeView.Nodes.Add "l" & p & rs!parent_urn, tvwChild, "l" & c & rs!urn, RTrim(rs!Child)
Form_frmSetsTree!axTreeView.Nodes("l" & c & rs!urn).Sorted = True
End If
rs.MoveNext
Loop
Can anyone spot the reason for this not working? The image does definitely exist...
Thanks in advance.
- Shaun