USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Tem como fazer Isto no TreeView?
Ricardo
não registrado
ENUNCIADA !
Postada em 09/08/2007 13:18 hs   
Olá tenho este código para carregar dados em uma treeview.
Será que é possivel criar uma rotina que ao digitar um texto em um text,  ele vai selecionando na treeview tipo (autosearch).


Private Sub carregaopcoes()
TabelaEspecie

    TB_ESPECIE.LockType = adLockOptimistic
    TB_ESPECIE.CursorType = adOpenStatic 'somente leitura
    TB_ESPECIE.CursorLocation = adUseServer

    TB_ESPECIE.Open "SELECT * FROM ESPECIE ", BD_CAIXA
   
    Do While Not TB_ESPECIE.EOF
        Set nodx = TreeView1.Nodes.Add(, , , TB_ESPECIE!descricao)
        'Set nodr = TreeView1.Nodes.Add(nodx, tvwChild, , TB_ESPECIE!descricao)
        TB_ESPECIE.MoveNext
    Loop
FechaTabelaEspecie
End Sub

   
kerplunk
Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 09/08/2007 15:00 hs         
Private Sub Text1_Change()
For i = 0 To TreeView1.Nodes.Count - 1
    If TreeView1.Nodes(i).Text = Text1.Text Then
       MsgBox "achei!"
    End If
Next i
End Sub
   
Ricardo
não registrado
ENUNCIADA !
Postada em 09/08/2007 15:35 hs   
Tentei seu código e deu o seguinte erro :
Run-time error "35600"
Index out of bonds
   
kerplunk
Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 10/08/2007 08:05 hs         
Se foi no primeiro item então o treeview é iniciado em 1 não em zero
   
Ricardo
não registrado
ENUNCIADA !
Postada em 10/08/2007 13:46 hs   
como assim???
   
kerplunk
Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 10/08/2007 15:05 hs         
  Private Sub Text1_Change()
For i = 1 To TreeView1.Nodes.Count 'iniciado em um não em zero
    If TreeView1.Nodes(i).Text = Text1.Text Then
       MsgBox "achei!"
    End If
Next i
End Sub
   
Página(s): 1/2      PRÓXIMA »


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2026   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página