#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
;Local $Str = FileRead('test.txt')
Local $Str = _
'济南市中大观园 3701001' & @CRLF & _
'济南市中经七路 3701002' & @CRLF & _
'济南市中六里山 3701003' & @CRLF & _
'济南市中七里山 3701004' & @CRLF & _
'济南市中二七村 3701005' & @CRLF & _
'济南市中玉函路 3701006' & @CRLF & _
'青岛市南金湖路 3702001' & @CRLF & _
'青岛市南中山路 3702002' & @CRLF & _
'青岛市a江苏路 3702003' & @CRLF & _
'青岛市a八大关 3702004' & @CRLF & _
'青岛市b八大湖 3702005' & @CRLF & _
'青岛市b湛山 3702006' & @CRLF & _
'青岛市b八大峡a 3702007'
$Form1 = GUICreate("级联菜单", 180, 143, -1, -1)
$button = GUICtrlCreateButton("读取", 50,100,80,30)
$Combo1 = GUICtrlCreateCombo("", 26, 8, 137, 25)
GUICtrlSetData(-1, "请选择...|济南|青岛", "请选择...")
$Combo2 = GUICtrlCreateCombo("", 26, 39, 137, 25)
GUISetState(@SW_SHOW)
$combo3 = GUICtrlCreateCombo("",26,70,137,25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Combo1
Switch GUICtrlRead($Combo1)
Case "请选择..."
GUICtrlSetData($Combo2, "")
GUICtrlSetData($Combo2, "", "")
GUICtrlSetData($combo3, "", "")
Case "济南"
GUICtrlSetData($Combo2, "")
GUICtrlSetData($Combo2, "市中|历下|天桥|槐荫", "")
Case "青岛"
GUICtrlSetData($Combo2, "")
GUICtrlSetData($Combo2, "市南|市北|李沧|城阳", "")
GUICtrlSetData($combo3, "", "")
EndSwitch
Case $Combo2
Switch GUICtrlRead($Combo2)
Case "市中"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"大观园|经七路|六里山|七里山|二七新村|玉函路","")
Case "历下"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"大明湖|解放路|轻骑路|趵突泉|司里街","")
Case "天桥"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"无","无")
Case "槐荫"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"无","无")
Case "市南"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"金湖路|中山路|江苏路|八大关|八大湖|湛山路|八大峡","")
Case "市北"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"登州路|冠县路|热河路|华阳路|延安路","")
Case "李沧"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"无","无")
Case "城阳"
GUICtrlSetData($combo3,"")
GUICtrlSetData($combo3,"无","无")
EndSwitch
Case $Button
If GUICtrlRead($Combo1) = '请选择' Then ContinueLoop
$tmp = GUICtrlRead($Combo1) & GUICtrlRead($Combo2) & GUICtrlRead($Combo3)
$var = StringRegExp($Str, $tmp & '\h+(\d+)', 3)
If Not @error Then MsgBox(64, '数据', '单位名称:' & $tmp & @LF & '单位代码:' & $var[0])
EndSwitch
WEnd