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 LoopFechaTabelaEspecie End Sub
|
|
|
|
|
|
kerplunk
|
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
|
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
|
|
|
|
kerplunk
|
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
|
|
|
|