本帖最后由 haijie1223 于 2013-1-23 16:17 编辑
不知道楼主是不是这个意思,如果是你看下哪个符合要求~
$main = GUICreate("test", 400, 300)
$com1 = GUICtrlCreateCombo("", 20, 20)
GUICtrlSetData(-1, "项目1|项目2|项目3", "项目1")
$com2 = GUICtrlCreateCombo("", 20, 80)
GUICtrlSetData(-1, "1|2", "1")
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $com1
GUICtrlSetData($com2, "")
If GUICtrlRead($com1) = "项目1" Then GUICtrlSetData($com2, "1|2", "1")
If GUICtrlRead($com1) = "项目2" Then GUICtrlSetData($com2, "4|5", "4")
If GUICtrlRead($com1) = "项目3" Then GUICtrlSetData($com2, "7|8", "7")
Case $com2
EndSwitch
WEnd
Opt("GUIDataSeparatorChar", "'")
$main = GUICreate("test", 400, 300)
$com1 = GUICtrlCreateCombo("", 20, 20)
GUICtrlSetData(-1, "项目1'项目2'项目3", "项目1")
$com2 = GUICtrlCreateCombo("", 20, 80)
GUICtrlSetData(-1, "1|2", "1|2")
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $com1
GUICtrlSetData($com2, "")
If GUICtrlRead($com1) = "项目1" Then GUICtrlSetData($com2, "1|2", "1|2")
If GUICtrlRead($com1) = "项目2" Then GUICtrlSetData($com2, "4|5", "4|5")
If GUICtrlRead($com1) = "项目3" Then GUICtrlSetData($com2, "7|8", "7|8")
Case $com2
EndSwitch
WEnd
|