示例:
Private Sub TreeView1_NodeClick(ByVal node As MSComctlLib.node) Text1.text = TreeView1.SelectedItem.key
Adodc1.RecordSource = "select * from StudentInfo where name=" + Trim(Text1.text) + "" Adodc1.Refresh If Adodc1.Recordset.RecordCount <> 0 Then Text2.text = Adodc1.Recordset.Fields("age") Text3.text = Adodc1.Recordset.Fields("email") End If End Sub 对节点的引用采用二处方法
1、节点的key值 TreeView1.SelectedItem.key
2、节点的text TreeView1.SelectedItem.text
|
|