vb treeview控件节点点击事件
DimnodexAsNodePrivateSubtreeview_add()TreeView1.Nodes.ClearTreeView1.Nodes.Add,,"root...
Dim nodex As Node
Private Sub treeview_add()
TreeView1.Nodes.Clear
TreeView1.Nodes.Add , , "root", "商品分类"
Reco.Open "select * from 商品分类", Conn, adOpenKeyset, adLockPessimistic
Do Until Reco.EOF
skey = Reco.Fields("商品分类")
Set nodex = TreeView1.Nodes.Add("root", tvwChild, skey, Reco.Fields("商品分类"))
Reco.MoveNext
Loop
Reco.Close End Sub
Private Sub Form_Load() Conn.Open "dsn=denglu;uid=;pwd="
treeview_add
End Sub
用上面这段代码我把treeview的节点弄好了,但是怎么实现 我点击节点名称,就显示数据表里面相关分类的数据呢?是不是用listview显示? 展开
Private Sub treeview_add()
TreeView1.Nodes.Clear
TreeView1.Nodes.Add , , "root", "商品分类"
Reco.Open "select * from 商品分类", Conn, adOpenKeyset, adLockPessimistic
Do Until Reco.EOF
skey = Reco.Fields("商品分类")
Set nodex = TreeView1.Nodes.Add("root", tvwChild, skey, Reco.Fields("商品分类"))
Reco.MoveNext
Loop
Reco.Close End Sub
Private Sub Form_Load() Conn.Open "dsn=denglu;uid=;pwd="
treeview_add
End Sub
用上面这段代码我把treeview的节点弄好了,但是怎么实现 我点击节点名称,就显示数据表里面相关分类的数据呢?是不是用listview显示? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询