Treeview control changing the picture to open folder/close folder 
Author Message
 Treeview control changing the picture to open folder/close folder

I have setup a treeview in my vb app ... each branch of the tree displays a
CLOSED folder. When the user clicks on a folder .. all other folders should
change to CLOSED folder picture and that folder should display an OPEN folder
picture.

Can anyone provide any guidance on this??

It must be something to do with the click event.... but I'm a bit
confused......

Ian



Fri, 04 Dec 1998 03:00:00 GMT  
 Treeview control changing the picture to open folder/close folder

Ian-
Assuming Image 1 is closed and Image 2 is opened...

Public Sub tvw_NodeClick(ByVal Node As Node)
   Static iPrevIndex As Integer
   On Error Resume Next      'For Deleted 'Previous' Index
   If Node.Index <> iPrevIndex And iPrevIndex > 0 Then
        tvw.Nodes(iPrevIndex).Image = 1
   End If
   iPrevIndex = Node.Index
   Node.Image = 2
End Sub



Sat, 05 Dec 1998 03:00:00 GMT  
 Treeview control changing the picture to open folder/close folder

Quote:

>Ian-
>Assuming Image 1 is closed and Image 2 is opened...

>Public Sub tvw_NodeClick(ByVal Node As Node)
>   Static iPrevIndex As Integer
>   On Error Resume Next      'For Deleted 'Previous' Index
>   If Node.Index <> iPrevIndex And iPrevIndex > 0 Then
>        tvw.Nodes(iPrevIndex).Image = 1
>   End If
>   iPrevIndex = Node.Index
>   Node.Image = 2
>End Sub

Thanks.. that has seemed to work a treat!!

thanks alot

Ian



Sat, 05 Dec 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Folder Open Dialog - How to pre-select folder

2. folder in a folder in a folder...

3. Build XML of folders, sub folders and files from specified folder

4. Determining if a folder is a local pst folder or a imap (server folder)

5. How to delete folders/files within a folder but not the folder itself

6. small open/closed Win95 folders, where?

7. Open, changing then saving a value in a form in a public folder

8. Outlook View control - accessing folders other than Default Folder

9. Drag and drop from folder to TreeView control?

10. Folder navigation through treeview control

11. folder selection with treeview control

12. Folder navigation through treeview control

 

 
Powered by phpBB® Forum Software