TreeView
Publicado por Javi (22 intervenciones) el 21/07/2003 19:36:13
Hola a tod@s:
Estuve mirando en el Foro y no vi ninguna solucion para crear un TreeView.
Asi que he estado investigando como desarrollar un TreeView y he llegado hasta aqui (por si le sirve a alguien):
With TreeView0
.Sorted = True
Set Nodos = .Nodes.Add()
.LabelEdit = False
' .LineStyle = tvwRootLines
End With
With Nodos ' Agregar el primer nodo.
.Text = "Padre1"
.Tag = "1"
End With
With TreeView0
.Sorted = True
Set Nodos = .Nodes.Add()
.LabelEdit = False
.LineStyle = tvwRootLines
End With
With Nodos ' Agregar el segundo nodo.
.Text = "Padre2"
.Tag = "2"
End With
With TreeView0
.Sorted = True
Set Nodos = .Nodes.Add()
.LabelEdit = False
.LineStyle = tvwRootLines
End With
With Nodos ' Agregar el tercer nodo.
.Text = "Padre3"
.Tag = "3"
End With
Set Nodos = TreeView0.Nodes.Add(1, tvwChild, , "Hijo1")
Set Nodos = TreeView0.Nodes.Add(1, tvwChild, , "Hijo2")
Set Nodos = TreeView0.Nodes.Add(3, tvwChild, , "Hijo3")
Set Nodos = TreeView0.Nodes.Add(3, tvwChild, , "Hijo4")
Esto funciona correctamente. Muestra un arbol jerarquico tipo Producto... Subproducto.
Pero lo que quiero ademas, es marcar uno de esos valores como seleccionado inicialmente y ademas si me selecionan otro poder identificarlo.
¿Alguien ha hecho algo parecido?
Muchas gracias anticipadas.
Salu2.
Javi
Estuve mirando en el Foro y no vi ninguna solucion para crear un TreeView.
Asi que he estado investigando como desarrollar un TreeView y he llegado hasta aqui (por si le sirve a alguien):
With TreeView0
.Sorted = True
Set Nodos = .Nodes.Add()
.LabelEdit = False
' .LineStyle = tvwRootLines
End With
With Nodos ' Agregar el primer nodo.
.Text = "Padre1"
.Tag = "1"
End With
With TreeView0
.Sorted = True
Set Nodos = .Nodes.Add()
.LabelEdit = False
.LineStyle = tvwRootLines
End With
With Nodos ' Agregar el segundo nodo.
.Text = "Padre2"
.Tag = "2"
End With
With TreeView0
.Sorted = True
Set Nodos = .Nodes.Add()
.LabelEdit = False
.LineStyle = tvwRootLines
End With
With Nodos ' Agregar el tercer nodo.
.Text = "Padre3"
.Tag = "3"
End With
Set Nodos = TreeView0.Nodes.Add(1, tvwChild, , "Hijo1")
Set Nodos = TreeView0.Nodes.Add(1, tvwChild, , "Hijo2")
Set Nodos = TreeView0.Nodes.Add(3, tvwChild, , "Hijo3")
Set Nodos = TreeView0.Nodes.Add(3, tvwChild, , "Hijo4")
Esto funciona correctamente. Muestra un arbol jerarquico tipo Producto... Subproducto.
Pero lo que quiero ademas, es marcar uno de esos valores como seleccionado inicialmente y ademas si me selecionan otro poder identificarlo.
¿Alguien ha hecho algo parecido?
Muchas gracias anticipadas.
Salu2.
Javi
Valora esta pregunta


0