C
Co
Hi All,
I have a problem with images in a Treeview.
I have a "closed folder" and "opened folder" set in the Treeview
settings but I also have two special
icons. A "closed folder with email" and an "opened folder with email",
they are index 3 and 4.
Now when I click a node and it has image 3 then it should show image 4
( the opened folder with email.)
That's working fine.
The problem is how can I change the image back to image 3 when I click
on another node?
Private Sub TreeView_AfterSelect(ByVal sender As Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles TreeView.AfterSelect
'if the user has a subscription on the folder then show
the right icon
Dim tn As TreeNode = TreeView.SelectedNode
If tn.SelectedImageIndex = 3 Then
tn.SelectedImageIndex = 4
tn.ImageIndex = 4
End If
End Sub
Marco
I have a problem with images in a Treeview.
I have a "closed folder" and "opened folder" set in the Treeview
settings but I also have two special
icons. A "closed folder with email" and an "opened folder with email",
they are index 3 and 4.
Now when I click a node and it has image 3 then it should show image 4
( the opened folder with email.)
That's working fine.
The problem is how can I change the image back to image 3 when I click
on another node?
Private Sub TreeView_AfterSelect(ByVal sender As Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles TreeView.AfterSelect
'if the user has a subscription on the folder then show
the right icon
Dim tn As TreeNode = TreeView.SelectedNode
If tn.SelectedImageIndex = 3 Then
tn.SelectedImageIndex = 4
tn.ImageIndex = 4
End If
End Sub
Marco