在我的脚本中:http://pastebin.com/Az6vabnK当另一个组合具有某个值时,我正在尝试进行组合显示:
Case $Combo2
If Read() = "Vanilla" Then
GUISwitch($GUI, $TabSheet2)
$Combo3 = GUICtrlCreateCombo("Choose Version", 10, 85, 161, 25, $CBS_DROPDOWNLIST)
GUICtrlSetData($Combo3, "Latest|1.6.4|1.6.2|1.5.2|1.4.7|1.4.5")
Else
GUISwitch($GUI, $TabSheet2)
GUICtrlDelete($Combo3)
EndIf
Func Read();The function for reading the state of the server type combo.
Return GUICtrlRead($Combo2)
EndFunc ;==>Read
同时它是:
AdlibRegister("Read")
读取值。出于某种原因,当组合更改值时没有任何反应。有什么想法吗?
答案 0 :(得分:1)
删除该AdlibRegister(“Read”),因为它什么都不做。 你已经在这里获得了$ combo2的价值
If Read() = "Vanilla" Then
$ Combo2应该是一个全局变量,或者你可以删除那个Read()函数并直接使用GuiCtrlRead
If GUICtrlRead($Combo2) = "Vanilla" Then
试试这个
If GUICtrlRead($Combo2) = "Vanilla" Then
GUISwitch($GUI, $TabSheet2)
$Combo3 = GUICtrlCreateCombo("Choose Version", 10, 85, 161, 25, $CBS_DROPDOWNLIST)
GUICtrlSetData($Combo3, "Latest|1.6.4|1.6.2|1.5.2|1.4.7|1.4.5")
GUICtrlCreateTabItem("")
Else
GUISwitch($GUI, $TabSheet2)
GUICtrlDelete($Combo3)
EndIf