vb中TreeView控件和数据库绑定出了问题
DimnodAsNodeSetnod=TreeView1.Nodes.Add(,,"Father",,1)Adodc1.Recordset.MoveFirstFori=0...
Dim nod As Node
Set nod = TreeView1.Nodes.Add(, , "Father", , 1)
Adodc1.Recordset.MoveFirst
For i = 0 To Adodc1.Recordset.RecordCount - 1
Set nod = TreeView1.Nodes.Add("Father", tvwchlid, , Adodc1.Recordset.Fields("sele_no"), 1)
Adodc1.Recordset.MoveNext
TreeView1.Refresh
TreeView1.Sorted = True
Next i
TreeView1.Sorted = True
TreeView1.LineStyle = tvwRootLines
出来后顺序不对,第一题对应第二个,第二个对应第三个。。。。。序号也不对:1 10 11 12 13 14 15 2 3 4 5
截图 展开
Set nod = TreeView1.Nodes.Add(, , "Father", , 1)
Adodc1.Recordset.MoveFirst
For i = 0 To Adodc1.Recordset.RecordCount - 1
Set nod = TreeView1.Nodes.Add("Father", tvwchlid, , Adodc1.Recordset.Fields("sele_no"), 1)
Adodc1.Recordset.MoveNext
TreeView1.Refresh
TreeView1.Sorted = True
Next i
TreeView1.Sorted = True
TreeView1.LineStyle = tvwRootLines
出来后顺序不对,第一题对应第二个,第二个对应第三个。。。。。序号也不对:1 10 11 12 13 14 15 2 3 4 5
截图 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询