elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Problema con treeview
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Problema con treeview  (Leído 1,507 veces)
SheKeL_C$


Desconectado Desconectado

Mensajes: 549


_-=[Sh3K3L_C$]=-_


Ver Perfil
Problema con treeview
« en: 29 Junio 2007, 15:10 pm »

M es imposible pensar/realizar un programa en el q yo l pase una ruta y el treeview me cree unos sub-nodos. Yo x ejemplo le paso una ruta en este formato "\carpeta\subcarpeta\y otra mas" y no se como acer para q m salga asi:

 \
 |---carpeta
 |-----subcarpeta
 |--------y otra mas

Alguien m podria poner un ejemplo?


En línea

d(-_-)b


Desconectado Desconectado

Mensajes: 1.331



Ver Perfil WWW
Re: Problema con treeview
« Respuesta #1 en: 29 Junio 2007, 21:14 pm »

Hola esto te puede servir

Código:
Private Sub Form_Load()

    With TreeView1.Nodes

     Set Root = .Add(, , , "Nombre")
        .Add Root.Index, tvwChild, , "alejandro"
        .Add Root.Index, tvwChild, , "alex"
        .Add Root.Index, tvwChild, , "raul"
        .Add Root.Index, tvwChild, , "carlos"
        .Add Root.Index, tvwChild, , "maria"
        .Add Root.Index, tvwChild, , "daniel"
     Set Root = .Add(, , , "Coches")
        .Add Root.Index, tvwChild, , "mercedez"
        .Add Root.Index, tvwChild, , "bmw"
        .Add Root.Index, tvwChild, , "honda"
        .Add Root.Index, tvwChild, , "renault"
        .Add Root.Index, tvwChild, , "opel"
     Set Root = .Add(, , , "Pais")
        .Add Root.Index, tvwChild, , "españa"
        .Add Root.Index, tvwChild, , "alemania"
        .Add Root.Index, tvwChild, , "francia"
        .Add Root.Index, tvwChild, , "miami"
        .Add Root.Index, tvwChild, , "ondura"
     Set Root = .Add(, , , "Comer")
        .Add Root.Index, tvwChild, , "vaca"
        .Add Root.Index, tvwChild, , "pollo"
        .Add Root.Index, tvwChild, , "pescado"
     Set Root = .Add(, , , "Trabajo")
        .Add Root.Index, tvwChild, , "construccion"
        .Add Root.Index, tvwChild, , "soldador"
        .Add Root.Index, tvwChild, , "carpintero"
     
   End With

End Sub

ok espero que te sirva esto,



En línea

Max 400; caracteres restantes: 366
SheKeL_C$


Desconectado Desconectado

Mensajes: 549


_-=[Sh3K3L_C$]=-_


Ver Perfil
Re: Problema con treeview
« Respuesta #2 en: 29 Junio 2007, 21:50 pm »

Lo q mejor m a funcionado es_

Código:
Public Sub AddFolder(Direccion As String, Tree As TreeView)
 On Local Error Resume Next
 Dim Separa()               As String
 Dim i                      As Integer
 Dim Ruta                   As String
 Dim Titulo                 As String
 
 
 
 Separa = Split(Direccion, "\")
 For i = 0 To UBound(Separa) - 1
    If i = 0 Then Ruta = "\" Else Ruta = Separa(i)
    Titulo = Separa(i + 1)
    Tree.Nodes.Add Ruta, 4, Titulo, Titulo
 Next i
 
End Sub
En línea

d(-_-)b


Desconectado Desconectado

Mensajes: 1.331



Ver Perfil WWW
Re: Problema con treeview
« Respuesta #3 en: 29 Junio 2007, 22:41 pm »

Bien no esta mal...
En línea

Max 400; caracteres restantes: 366
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Treeview VB.net
Programación General
tazrebelraider 0 3,297 Último mensaje 28 Febrero 2012, 05:53 am
por tazrebelraider
Problema treeview al eliminar nodo hijo
Programación Visual Basic
elezekiel 0 2,591 Último mensaje 12 Noviembre 2014, 16:02 pm
por elezekiel
treeview.index
.NET (C#, VB.NET, ASP)
luismercedesrd 1 2,077 Último mensaje 10 Junio 2016, 03:03 am
por AlbertoBSD
Seleccionar Nodo de Treeview « 1 2 »
Programación Visual Basic
jack06 10 7,039 Último mensaje 8 Mayo 2017, 21:11 pm
por jack06
Ayuda treeview
.NET (C#, VB.NET, ASP)
alexlopez91 1 2,305 Último mensaje 18 Agosto 2017, 00:23 am
por Hadess_inf
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines