Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview again : 1

Status
Not open for further replies.

edderic

Programmer
May 8, 1999
628
I have next nodes in a threeview :

- Akte 2
- Que 1:
- Playback 1:
-Move1
-Move3
-Move4
- Playback 2:
-Move5
-Move6
-Move7
- Akte 3
- Que 2:
- Playback 2 :
-Move4
-Move1
-Move3

Ho can i with the index ,set those nodes bacground !!
so i click on Que 2 then the bacground most gris ,if i click then on Playback 2 then the Que 2 bacground most to white and the Playback 2 background most set to gris

Thanks

Eric
Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
Hi Eric,

So you basically want to set a background colour to the node you select and set the colour of the previous selected node to white. Is that it?

Ok just store the index of the currently and previously selected item everytime you do a node click.

Use this on the node_click event:

if currentnodeindex > 0 then
oldnodeindex=currentnodeindex
End if

currentnodeindex=tvwDB.selecteditem.index

if oldnodeindex > 0 then
tvwDB.Nodes(oldnodeindex).BackColor = RGB(255, 255, 255)
End if

tvwDB.Nodes(currentnodeindex).BackColor = RGB(code for gris)

This should do it.

Let me know if you need more help.
 
daimaou,

It set all the nodes to gris :whats wrong ?

Private Sub tvwDB_Click()
Dim Current_node As Integer
Dim OldCurrent_node As Integer

With tvwDB.Nodes
If Current_node > 0 Then
OldCurrent_node = Current_node
End If
Current_node = tvwDB.SelectedItem.Index
If OldCurrent_node > 0 Then
tvwDB.Nodes(OldCurrent_node).BackColor = vbWhite 'RGB(255, 255, 255)
End If
tvwDB.Nodes(Current_node).BackColor = &H8000000F

End With

End Sub

Thanks

Eric Eric De Decker
vbg.be@vbgroup.nl

 
Eric,
Just declare Current_node and OldCurrent_node as public variables on your code module and your problem will be fixed.
 
Thanks its works now Eric De Decker
vbg.be@vbgroup.nl

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top