请教,如何用 vb与Xml 做成和QQ一样的 选择国家地区的联动结构?
============以下是XMl结构 拷贝到记事本 改名为:chinese.xml==========<?xml version="1.0" encoding="utf-8"?>
<Location>
<CountryRegion Name="中国" Code="1">
<State Name="北京" Code="11">
<City Name="东城" Code="1"/>
<City Name="西城" Code="2"/>
<City Name="崇文" Code="3"/>
<City Name="宣武" Code="4"/>
<City Name="朝阳" Code="5"/>
<City Name="丰台" Code="6"/>
<City Name="石景山" Code="7"/>
<City Name="海淀" Code="8"/>
<City Name="门头沟" Code="9"/>
<City Name="房山" Code="11"/>
<City Name="通州" Code="12"/>
<City Name="顺义" Code="13"/>
<City Name="昌平" Code="21"/>
<City Name="大兴" Code="24"/>
<City Name="怀柔" Code="27"/>
<City Name="平谷" Code="26"/>
<City Name="密云" Code="28"/>
<City Name="延庆" Code="29"/>
</State>
</CountryRegion>
<CountryRegion Name="越南" Code="VNM">
<State >
<City Name="海防" Code="HP"/>
<City Name="河内" Code="HI"/>
<City Name="胡志明市" Code="HC"/>
</State>
</CountryRegion>
<CountryRegion Name="赞比亚" Code="ZMB">
<State >
<City Name="北方" Code="NO"/>
<City Name="东方" Code="EA"/>
<City Name="卢阿普拉" Code="LP"/>
<City Name="卢萨卡" Code="LK"/>
<City Name="南方" Code="SO"/>
<City Name="铜带" Code="CB"/>
<City Name="西北" Code="NW"/>
<City Name="西方" Code="WE"/>
<City Name="中央" Code="CE"/>
</State>
</CountryRegion>
<CountryRegion Name="泽西岛" Code="JEY" />
<CountryRegion Name="乍得" Code="TCD" />
<CountryRegion Name="直布罗陀" Code="GIB" />
<CountryRegion Name="智利" Code="CHL">
<State >
<City Name="阿劳卡尼亚大区" Code="AR"/>
<City Name="阿塔卡马大区" Code="AT"/>
<City Name="安托法加斯塔大区" Code="AN"/>
<City Name="比奥比奥大区" Code="BI"/>
<City Name="复活节岛" Code="LI"/>
<City Name="湖大区" Code="LL"/>
<City Name="科金博大区" Code="CO"/>
<City Name="马乌莱大区" Code="ML"/>
<City Name="麦哲伦-智利南极大区" Code="MA"/>
<City Name="圣地亚哥" Code="RM"/>
<City Name="塔拉帕卡大区" Code="TA"/>
<City Name="瓦尔帕莱索大区" Code="VS"/>
<City Name="伊瓦涅斯将军的艾森大区" Code="AI"/>
</State>
</CountryRegion>
<CountryRegion Name="中非共和国" Code="CAF">
<State >
<City Name="巴明吉-班戈兰" Code="BB"/>
<City Name="班吉直辖市" Code="BGF"/>
<City Name="宾博" Code="BI"/>
<City Name="凯莫" Code="KG"/>
<City Name="洛巴伊" Code="LB"/>
<City Name="曼贝雷-卡代" Code="HS"/>
<City Name="姆博穆" Code="MB"/>
<City Name="纳纳-格里比齐" Code="KB"/>
<City Name="纳纳-曼贝雷" Code="NM"/>
<City Name="桑加-姆巴埃雷" Code="SE"/>
<City Name="上科托" Code="HK"/>
<City Name="上姆博穆" Code="HM"/>
<City Name="瓦卡" Code="UK"/>
<City Name="瓦卡加" Code="VK"/>
<City Name="瓦姆" Code="AC"/>
<City Name="瓦姆-彭代" Code="OP"/>
<City Name="翁贝拉-姆波科" Code="MP"/>
<City Name="下科托" Code="BK"/>
</State>
</CountryRegion>
</Location>
=============以下是可参考vb代码===================
Private Sub Command1_Click()
On Error Resume Next
Dim blnBLoad As Boolean
Dim i As Integer
Dim j As Long
Dim k As Long
Set Xml = New DOMDocument
bLoad = Xml.Load(App.Path & "\chinese.xml")
If bLoad = False Then
MsgBox "Error"
Exit Sub
End If
Dim root As IXMLDOMElement
Set root = Xml.documentElement
Dim node As IXMLDOMNode
Dim sec_node As IXMLDOMNode
Dim thr_node As IXMLDOMNode
Dim fro_node As IXMLDOMNode
For Each node In root.childNodes
Text1.Text = Text1.Text & "国家:" & node.Attributes.getNamedItem("Name").Text & vbCrLf
For Each sec_node In node.childNodes
If sec_node.nodeName = "State" Then
Text2.Text = Text2.Text & "州/省:" & sec_node.Attributes.getNamedItem("Name").Text & vbCrLf
For Each thr_node In node.childNodes
Text3.Text = Text3.Text & "城市:" & thr_node.Attributes.getNamedItem("Name").Text & vbCrLf
Next
Else
End If
Next
Next
End Sub
做成三个Combo的联动效果。