关于用组合框分类的问题(已解决)
本帖最后由 papapa314 于 2010-12-29 10:53 编辑我想实现的功能是,在第一个组合框里选“小学教育”的时候,第二个组合框里只会出现“数学”和“语文”和“英语”,在第一个组合框里选“中学教育”,第二个组合框里会出现数学,语文,物理,化学,地理,历史,政治。我用以下的方法实现不了,真心得请教各位!谢谢!
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 471, 304, 192, 124)
$combo1=GUICtrlCreateCombo("", 144, 104, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$combo2=GUICtrlCreateCombo("", 144, 184, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($combo1,"小学教育")
GUICtrlSetData($combo1,"中学教育")
IfGUICtrlRead($combo1)= "小学教育" Then
GUICtrlSetData($combo2,"数学")
GUICtrlSetData($combo2,"语文")
GUICtrlSetData($combo2,"英语")
EndIf
If GUICtrlRead($combo1)= "中学教育" Then
GUICtrlSetData($combo2,"语文")
GUICtrlSetData($combo2,"数学")
GUICtrlSetData($combo2,"物理")
GUICtrlSetData($combo2,"化学")
GUICtrlSetData($combo2,"地理")
GUICtrlSetData($combo2,"历史")
GUICtrlSetData($combo2,"政治")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
我刚学了三天的autoit,如果提问太过幼稚,请各位大大多多包涵! 谁没有幼稚过呢?
其实你已经非常接近成功了。
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 471, 304, 192, 124)
$combo1 = GUICtrlCreateCombo("", 144, 104, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
$combo2 = GUICtrlCreateCombo("", 144, 184, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($combo1, "小学教育")
GUICtrlSetData($combo1, "中学教育")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $combo1
If GUICtrlRead($combo1) = "小学教育" Then
GUICtrlSetData($combo2, "")
GUICtrlSetData($combo2, "数学")
GUICtrlSetData($combo2, "语文")
GUICtrlSetData($combo2, "英语")
Else
GUICtrlSetData($combo2, "")
GUICtrlSetData($combo2, "语文")
GUICtrlSetData($combo2, "数学")
GUICtrlSetData($combo2, "物理")
GUICtrlSetData($combo2, "化学")
GUICtrlSetData($combo2, "地理")
GUICtrlSetData($combo2, "历史")
GUICtrlSetData($combo2, "政治")
EndIf
EndSwitch
WEnd
握手中,谢谢!一定加紧学习呵呵 谢谢3smile大哥,呵呵 楼主刚学三天就达到这地步了.厉害啊 3天这样的水平 不错 谁没有幼稚过呢?
其实你已经非常接近成功了。
3mile 发表于 2010-12-28 19:57 http://www.autoitx.com/images/common/back.gif
3mile 这话说得太入人心了! 哈哈。。顶你。。。
页:
[1]