找回密码
 加入
搜索
查看: 2444|回复: 5

为什么复选框不能够判断是否被选中?

[复制链接]
发表于 2009-9-3 15:18:18 | 显示全部楼层 |阅读模式
本帖最后由 dtooboss 于 2009-9-3 15:20 编辑

我是初学者,各位帮忙看看。
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("暗黑地图cfg生成器", 461, 688, 303, 154)
Dim $Checkbox[200], $cb[200]
$h = 12
$PageControl1 = GUICtrlCreateTab(8, 8, 440, 600)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("暗金物品")
GUICtrlSetDefColor(0x663300)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",1,""), '//', 1)
$Checkbox[1] = GUICtrlCreateCheckbox($text[2], 20, 40, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",2,""), '//', 1)
$Checkbox[2] = GUICtrlCreateCheckbox($text[2], 20, 40+1*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",3,""), '//', 1)
$Checkbox[3] = GUICtrlCreateCheckbox($text[2], 20, 40+2*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",4,""), '//', 1)
$Checkbox[4] = GUICtrlCreateCheckbox($text[2], 20, 40+3*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",5,""), '//', 1)
$Checkbox[5] = GUICtrlCreateCheckbox($text[2], 20, 40+4*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",6,""), '//', 1)
$Checkbox[6] = GUICtrlCreateCheckbox($text[2], 20, 40+5*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",7,""), '//', 1)
$Checkbox[7] = GUICtrlCreateCheckbox($text[2], 20, 40+6*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",8,""), '//', 1)
$Checkbox[8] = GUICtrlCreateCheckbox($text[2], 20, 40+7*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",9,""), '//', 1)
$Checkbox[9] = GUICtrlCreateCheckbox($text[2], 20, 40+8*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",10,""), '//', 1)
$Checkbox[10] = GUICtrlCreateCheckbox($text[2], 20, 40+9*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",11,""), '//', 1)
$Checkbox[11] = GUICtrlCreateCheckbox($text[2], 20, 40+10*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",12,""), '//', 1)
$Checkbox[12] = GUICtrlCreateCheckbox($text[2], 20, 40+11*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",13,""), '//', 1)
$Checkbox[13] = GUICtrlCreateCheckbox($text[2], 20, 40+12*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",14,""), '//', 1)
$Checkbox[14] = GUICtrlCreateCheckbox($text[2], 20, 40+13*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",15,""), '//', 1)
$Checkbox[15] = GUICtrlCreateCheckbox($text[2], 20, 40+14*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",16,""), '//', 1)
$Checkbox[16] = GUICtrlCreateCheckbox($text[2], 20, 40+15*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",17,""), '//', 1)
$Checkbox[17] = GUICtrlCreateCheckbox($text[2], 20, 40+16*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",18,""), '//', 1)
$Checkbox[18] = GUICtrlCreateCheckbox($text[2], 20, 40+17*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",19,""), '//', 1)
$Checkbox[19] = GUICtrlCreateCheckbox($text[2], 20, 40+18*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",20,""), '//', 1)
$Checkbox[20] = GUICtrlCreateCheckbox($text[2], 20, 40+19*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",21,""), '//', 1)
$Checkbox[21] = GUICtrlCreateCheckbox($text[2], 20, 40+20*$h, 200, 17)


$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",22,""), '//', 1)
$Checkbox[22] = GUICtrlCreateCheckbox($text[2], 20, 40+21*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",23,""), '//', 1)
$Checkbox[23] = GUICtrlCreateCheckbox($text[2], 20, 40+22*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",24,""), '//', 1)
$Checkbox[24] = GUICtrlCreateCheckbox($text[2], 20, 40+23*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",25,""), '//', 1)
$Checkbox[25] = GUICtrlCreateCheckbox($text[2], 20, 40+24*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",26,""), '//', 1)
$Checkbox[26] = GUICtrlCreateCheckbox($text[2], 20, 40+25*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",27,""), '//', 1)
$Checkbox[27] = GUICtrlCreateCheckbox($text[2], 20, 40+26*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",28,""), '//', 1)
$Checkbox[28] = GUICtrlCreateCheckbox($text[2], 20, 40+27*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",29,""), '//', 1)
$Checkbox[29] = GUICtrlCreateCheckbox($text[2], 20, 40+28*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",30,""), '//', 1)
$Checkbox[30] = GUICtrlCreateCheckbox($text[2], 20, 40+29*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",31,""), '//', 1)
$Checkbox[31] = GUICtrlCreateCheckbox($text[2], 20, 40+30*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",32,""), '//', 1)
$Checkbox[32] = GUICtrlCreateCheckbox($text[2], 20, 40+31*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",33,""), '//', 1)
$Checkbox[33] = GUICtrlCreateCheckbox($text[2], 20, 40+32*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",34,""), '//', 1)
$Checkbox[34] = GUICtrlCreateCheckbox($text[2], 20, 40+33*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",35,""), '//', 1)
$Checkbox[35] = GUICtrlCreateCheckbox($text[2], 20, 40+34*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",36,""), '//', 1)
$Checkbox[36] = GUICtrlCreateCheckbox($text[2], 20, 40+35*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",37,""), '//', 1)
$Checkbox[37] = GUICtrlCreateCheckbox($text[2], 20, 40+36*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",38,""), '//', 1)
$Checkbox[38] = GUICtrlCreateCheckbox($text[2], 20, 40+37*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",39,""), '//', 1)
$Checkbox[39] = GUICtrlCreateCheckbox($text[2], 20, 40+38*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",40,""), '//', 1)
$Checkbox[40] = GUICtrlCreateCheckbox($text[2], 20, 40+39*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",41,""), '//', 1)
$Checkbox[41] = GUICtrlCreateCheckbox($text[2], 20, 40+40*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",42,""), '//', 1)
$Checkbox[42] = GUICtrlCreateCheckbox($text[2], 20, 40+41*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",43,""), '//', 1)
$Checkbox[43] = GUICtrlCreateCheckbox($text[2], 20, 40+42*$h, 200, 17)


$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",44,""), '//', 1)
$Checkbox[44] = GUICtrlCreateCheckbox($text[2], 220, 40, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",45,""), '//', 1)
$Checkbox[45] = GUICtrlCreateCheckbox($text[2], 220, 40+1*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",46,""), '//', 1)
$Checkbox[46] = GUICtrlCreateCheckbox($text[2], 220, 40+2*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",47,""), '//', 1)
$Checkbox[47] = GUICtrlCreateCheckbox($text[2], 220, 40+3*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",48,""), '//', 1)
$Checkbox[48] = GUICtrlCreateCheckbox($text[2], 220, 40+4*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",49,""), '//', 1)
$Checkbox[49] = GUICtrlCreateCheckbox($text[2], 220, 40+5*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",50,""), '//', 1)
$Checkbox[50] = GUICtrlCreateCheckbox($text[2], 220, 40+6*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",51,""), '//', 1)
$Checkbox[51] = GUICtrlCreateCheckbox($text[2], 220, 40+7*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",52,""), '//', 1)
$Checkbox[52] = GUICtrlCreateCheckbox($text[2], 220, 40+8*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",53,""), '//', 1)
$Checkbox[53] = GUICtrlCreateCheckbox($text[2], 220, 40+9*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",54,""), '//', 1)
$Checkbox[54] = GUICtrlCreateCheckbox($text[2], 220, 40+10*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",55,""), '//', 1)
$Checkbox[55] = GUICtrlCreateCheckbox($text[2], 220, 40+11*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",56,""), '//', 1)
$Checkbox[56] = GUICtrlCreateCheckbox($text[2], 220, 40+12*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",57,""), '//', 1)
$Checkbox[57] = GUICtrlCreateCheckbox($text[2], 220, 40+13*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",58,""), '//', 1)
$Checkbox[58] = GUICtrlCreateCheckbox($text[2], 220, 40+14*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",59,""), '//', 1)
$Checkbox[59] = GUICtrlCreateCheckbox($text[2], 220, 40+15*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",60,""), '//', 1)
$Checkbox[60] = GUICtrlCreateCheckbox($text[2], 220, 40+16*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",61,""), '//', 1)
$Checkbox[61] = GUICtrlCreateCheckbox($text[2], 220, 40+17*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",62,""), '//', 1)
$Checkbox[62] = GUICtrlCreateCheckbox($text[2], 220, 40+18*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",63,""), '//', 1)
$Checkbox[63] = GUICtrlCreateCheckbox($text[2], 220, 40+19*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",64,""), '//', 1)
$Checkbox[64] = GUICtrlCreateCheckbox($text[2], 220, 40+20*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",65,""), '//', 1)
$Checkbox[65] = GUICtrlCreateCheckbox($text[2], 220, 40+21*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",66,""), '//', 1)
$Checkbox[66] = GUICtrlCreateCheckbox($text[2], 220, 40+22*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",67,""), '//', 1)
$Checkbox[67] = GUICtrlCreateCheckbox($text[2], 220, 40+23*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",68,""), '//', 1)
$Checkbox[68] = GUICtrlCreateCheckbox($text[2], 220, 40+24*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",69,""), '//', 1)
$Checkbox[69] = GUICtrlCreateCheckbox($text[2], 220, 40+25*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",70,""), '//', 1)
$Checkbox[70] = GUICtrlCreateCheckbox($text[2], 220, 40+26*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",71,""), '//', 1)
$Checkbox[71] = GUICtrlCreateCheckbox($text[2], 220, 40+27*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",72,""), '//', 1)
$Checkbox[72] = GUICtrlCreateCheckbox($text[2], 220, 40+28*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",73,""), '//', 1)
$Checkbox[73] = GUICtrlCreateCheckbox($text[2], 220, 40+29*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",74,""), '//', 1)
$Checkbox[74] = GUICtrlCreateCheckbox($text[2], 220, 40+30*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",75,""), '//', 1)
$Checkbox[75] = GUICtrlCreateCheckbox($text[2], 220, 40+31*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",76,""), '//', 1)
$Checkbox[76] = GUICtrlCreateCheckbox($text[2], 220, 40+32*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",77,""), '//', 1)
$Checkbox[77] = GUICtrlCreateCheckbox($text[2], 220, 40+33*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",78,""), '//', 1)
$Checkbox[78] = GUICtrlCreateCheckbox($text[2], 220, 40+34*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",79,""), '//', 1)
$Checkbox[79] = GUICtrlCreateCheckbox($text[2], 220, 40+35*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",80,""), '//', 1)
$Checkbox[80] = GUICtrlCreateCheckbox($text[2], 220, 40+36*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",81,""), '//', 1)
$Checkbox[81] = GUICtrlCreateCheckbox($text[2], 220, 40+37*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",82,""), '//', 1)
$Checkbox[82] = GUICtrlCreateCheckbox($text[2], 220, 40+38*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",83,""), '//', 1)
$Checkbox[83] = GUICtrlCreateCheckbox($text[2], 220, 40+39*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",84,""), '//', 1)
$Checkbox[84] = GUICtrlCreateCheckbox($text[2], 220, 40+40*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",85,""), '//', 1)
$Checkbox[85] = GUICtrlCreateCheckbox($text[2], 220, 40+41*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",86,""), '//', 1)
$Checkbox[86] = GUICtrlCreateCheckbox($text[2], 220, 40+42*$h, 200, 17)




$TabSheet2 = GUICtrlCreateTabItem("套装,材料,杂物")
GUICtrlSetDefColor(0x339933)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",87,""), '//', 1)
$Checkbox[87] = GUICtrlCreateCheckbox($text[2], 20, 40, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",88,""), '//', 1)
$Checkbox[88] = GUICtrlCreateCheckbox($text[2], 20, 40+1*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",89,""), '//', 1)
$Checkbox[89] = GUICtrlCreateCheckbox($text[2], 20, 40+2*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",90,""), '//', 1)
$Checkbox[90] = GUICtrlCreateCheckbox($text[2], 20, 40+3*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",91,""), '//', 1)
$Checkbox[91] = GUICtrlCreateCheckbox($text[2], 20, 40+4*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",92,""), '//', 1)
$Checkbox[92] = GUICtrlCreateCheckbox($text[2], 20, 40+5*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",93,""), '//', 1)
$Checkbox[93] = GUICtrlCreateCheckbox($text[2], 20, 40+6*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",94,""), '//', 1)
$Checkbox[94] = GUICtrlCreateCheckbox($text[2], 20, 40+7*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",95,""), '//', 1)
$Checkbox[95] = GUICtrlCreateCheckbox($text[2], 20, 40+8*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",96,""), '//', 1)
$Checkbox[96] = GUICtrlCreateCheckbox($text[2], 20, 40+9*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",97,""), '//', 1)
$Checkbox[97] = GUICtrlCreateCheckbox($text[2], 20, 40+10*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",98,""), '//', 1)
$Checkbox[98] = GUICtrlCreateCheckbox($text[2], 20, 40+11*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",99,""), '//', 1)
$Checkbox[99] = GUICtrlCreateCheckbox($text[2], 20, 40+12*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",100,""), '//', 1)
$Checkbox[100] = GUICtrlCreateCheckbox($text[2], 20, 40+13*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",101,""), '//', 1)
$Checkbox[101] = GUICtrlCreateCheckbox($text[2], 20, 40+14*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",102,""), '//', 1)
$Checkbox[102] = GUICtrlCreateCheckbox($text[2], 20, 40+15*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",103,""), '//', 1)
$Checkbox[103] = GUICtrlCreateCheckbox($text[2], 20, 40+16*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",104,""), '//', 1)
$Checkbox[104] = GUICtrlCreateCheckbox($text[2], 20, 40+17*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",105,""), '//', 1)
$Checkbox[105] = GUICtrlCreateCheckbox($text[2], 20, 40+18*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",106,""), '//', 1)
$Checkbox[106] = GUICtrlCreateCheckbox($text[2], 20, 40+19*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",107,""), '//', 1)
$Checkbox[107] = GUICtrlCreateCheckbox($text[2], 20, 40+20*$h, 200, 17)
GUICtrlSetDefColor(0x000066)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",108,""), '//', 1)
$Checkbox[108] = GUICtrlCreateCheckbox($text[2], 20, 40+21*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",109,""), '//', 1)
$Checkbox[109] = GUICtrlCreateCheckbox($text[2], 20, 40+22*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",110,""), '//', 1)
$Checkbox[110] = GUICtrlCreateCheckbox($text[2], 20, 40+23*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",111,""), '//', 1)
$Checkbox[111] = GUICtrlCreateCheckbox($text[2], 20, 40+24*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",112,""), '//', 1)
$Checkbox[112] = GUICtrlCreateCheckbox($text[2], 20, 40+25*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",113,""), '//', 1)
$Checkbox[113] = GUICtrlCreateCheckbox($text[2], 20, 40+26*$h, 200, 17)
GUICtrlSetDefColor(0x0)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",114,""), '//', 1)
$Checkbox[114] = GUICtrlCreateCheckbox($text[2], 20, 40+27*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",115,""), '//', 1)
$Checkbox[115] = GUICtrlCreateCheckbox($text[2], 20, 40+28*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",116,""), '//', 1)
$Checkbox[116] = GUICtrlCreateCheckbox($text[2], 20, 40+29*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",117,""), '//', 1)
$Checkbox[117] = GUICtrlCreateCheckbox($text[2], 20, 40+30*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",118,""), '//', 1)
$Checkbox[118] = GUICtrlCreateCheckbox($text[2], 20, 40+31*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",119,""), '//', 1)
$Checkbox[119] = GUICtrlCreateCheckbox($text[2], 20, 40+32*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",120,""), '//', 1)
$Checkbox[120] = GUICtrlCreateCheckbox($text[2], 20, 40+33*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",121,""), '//', 1)
$Checkbox[121] = GUICtrlCreateCheckbox($text[2], 20, 40+34*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",122,""), '//', 1)
$Checkbox[122] = GUICtrlCreateCheckbox($text[2], 20, 40+35*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",123,""), '//', 1)
$Checkbox[123] = GUICtrlCreateCheckbox($text[2], 20, 40+36*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",124,""), '//', 1)
$Checkbox[124] = GUICtrlCreateCheckbox($text[2], 20, 40+37*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",125,""), '//', 1)
$Checkbox[125] = GUICtrlCreateCheckbox($text[2], 20, 40+38*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",126,""), '//', 1)
$Checkbox[126] = GUICtrlCreateCheckbox($text[2], 20, 40+39*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",127,""), '//', 1)
$Checkbox[127] = GUICtrlCreateCheckbox($text[2], 20, 40+40*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",128,""), '//', 1)
$Checkbox[128] = GUICtrlCreateCheckbox($text[2], 20, 40+41*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",129,""), '//', 1)
$Checkbox[129] = GUICtrlCreateCheckbox($text[2], 20, 40+42*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",130,""), '//', 1)
$Checkbox[130] = GUICtrlCreateCheckbox($text[2], 20, 40+43*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",131,""), '//', 1)
$Checkbox[131] = GUICtrlCreateCheckbox($text[2], 220, 40, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",132,""), '//', 1)
$Checkbox[132] = GUICtrlCreateCheckbox($text[2], 220, 40+1*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",133,""), '//', 1)
$Checkbox[133] = GUICtrlCreateCheckbox($text[2], 220, 40+2*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",134,""), '//', 1)
$Checkbox[134] = GUICtrlCreateCheckbox($text[2], 220, 40+3*$h, 200, 17)
GUICtrlSetDefColor(0x663300)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",135,""), '//', 1)
$Checkbox[135] = GUICtrlCreateCheckbox($text[2], 220, 40+4*$h, 200, 17)
GUICtrlSetDefColor(0xcc6633)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",136,""), '//', 1)
$Checkbox[136] = GUICtrlCreateCheckbox($text[2], 220, 40+5*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",137,""), '//', 1)
$Checkbox[137] = GUICtrlCreateCheckbox($text[2], 220, 40+6*$h, 200, 17)
GUICtrlSetDefColor(0x663300)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",138,""), '//', 1)
$Checkbox[138] = GUICtrlCreateCheckbox($text[2], 220, 40+7*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",139,""), '//', 1)
$Checkbox[139] = GUICtrlCreateCheckbox($text[2], 220, 40+8*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",140,""), '//', 1)
$Checkbox[140] = GUICtrlCreateCheckbox($text[2], 220, 40+9*$h, 200, 17)

$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",141,""), '//', 1)
$Checkbox[141] = GUICtrlCreateCheckbox($text[2], 220, 40+10*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",142,""), '//', 1)
$Checkbox[142] = GUICtrlCreateCheckbox($text[2], 220, 40+11*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",143,""), '//', 1)
$Checkbox[143] = GUICtrlCreateCheckbox($text[2], 220, 40+12*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",144,""), '//', 1)
$Checkbox[144] = GUICtrlCreateCheckbox($text[2], 220, 40+13*$h, 200, 17)
GUICtrlSetDefColor(0x663300)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",145,""), '//', 1)
$Checkbox[145] = GUICtrlCreateCheckbox($text[2], 220, 40+14*$h, 200, 17)
GUICtrlSetDefColor(0x9932cc)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",146,""), '//', 1)
$Checkbox[146] = GUICtrlCreateCheckbox($text[2], 220, 40+15*$h, 200, 17)
$text= StringSplit(IniRead("E:\4-17\au3\item.ini","anjin",147,""), '//', 1)
$Checkbox[147] = GUICtrlCreateCheckbox($text[2], 220, 40+16*$h, 200, 17)


$TabSheet3 = GUICtrlCreateTabItem("待补充物品")
GUICtrlCreateTabItem("")
GUICtrlSetDefColor(0x0)
$Button1 = GUICtrlCreateButton("确定(&O)", 54, 648, 75, 25, 0)
$Button2 = GUICtrlCreateButton("取消(&C)", 190, 648, 75, 25, 0)
$Button3 = GUICtrlCreateButton("帮助(&H)", 328, 648, 75, 25, 0)
GUISetState(@SW_SHOW)





While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
       Case $Button1;$msg的值等于$Button_3时获取当前选中的复选框
                     $checked = '';先把$checked赋予一次空值,这样做是防止此前判断过的值被再次利用,造成判断错误
                        ;依旧是利用for循环判断选中的复选框,若选中的话则用ControlGetText函数根据复选框控件id获取它的说明文字
                     For $i = 1 To 200
                                ;GUICtrlRead读取复选框状态
                                ;BitAND进行与运算
                                ;ControlGetText读取复选框说明文字
    ;                            If BitAND(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED)         Then $checked &= ControlGetText($TabSheet1, "", $Checkbox[$i]) & @LF;$checked变量与自身进行连接

                                ;下面是不使用与运算的判断是否选中的方法
                    if GUICtrlRead($Checkbox[$i],1) = $GUI_CHECKED Then $checked &= ControlGetText($Form3, "", $checkbox[$i]) & @LF
                    Next
                      If $checked = '' Then
                               ;$checked为空的时候进行未选中提示
                               MsgBox(0, '', '当前没有任何复选框被选中!', 5, $Form3)
                       Else
                                ;$checked不为空的时候进行选中提示
                              MsgBox(0, '', '被选中的复选框为' & @LF & $checked, 5, $Form3)
                      EndIf
;                Case $check[86];当GUI上的消息是对$check[4]控件操作时,运行以下代码
                        ;判断$check[4]是否选中,并对label进行修改
  
                       
        EndSwitch
WEnd
老是这句提示错误
if GUICtrlRead($Checkbox[$i],1) = $GUI_CHECKED Then $checked &= ControlGetText($Form3, "", $checkbox[$i]) & @LF
发表于 2009-9-3 16:18:45 | 显示全部楼层
本帖最后由 顽固不化 于 2009-9-3 16:20 编辑

if GUICtrlRead($Checkbox[$i],1) = $GUI_CHECKED Then..........
启用了高级模式后返回的是控件的文本,而$GUI_CHECKED 是控件被选中后的状态,这两种不同类型如何能划等号呢?
另外,就状态而言,用这种“等于”的方式也将出现错误的。

给你举个简单的例子:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
dim $Checkbox[4]
$Form1 = GUICreate("Form1", 633, 447, 120, 124)
$Checkbox[1] = GUICtrlCreateCheckbox("复选框1", 40, 72, 105, 41)
$Checkbox[2] = GUICtrlCreateCheckbox("复选框2", 40, 120, 105, 65)
$Checkbox[3] = GUICtrlCreateCheckbox("复选框3", 40, 216, 113, 49)
$BT=GUICtrlCreateButton("读取",40,300,110,25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $BT
                        for $i=1 To 3
                                $Name=GUICtrlRead($Checkbox[$i],1)
                                If BitAND(GUICtrlRead($Checkbox[$i]),$GUI_CHECKED) Then
                                        $ST="已选中"
                                Else
                                        $ST="未选中"
                                EndIf
                                MsgBox(0,"读取状态","控件文本: "&$Name &@CRLF &  "状 态 是: "&$ST)
                        Next

        EndSwitch
WEnd
 楼主| 发表于 2009-9-3 16:24:12 | 显示全部楼层
2# 顽固不化
不加 1 也是出错
不能返回状态
发表于 2009-9-3 16:30:26 | 显示全部楼层
if GUICtrlRead($Checkbox[$i]) =1 then msgbox(0,"选中")
 楼主| 发表于 2009-9-3 16:35:37 | 显示全部楼层
感谢感谢非常感谢
已经解决了谢谢!
发表于 2009-9-3 16:36:49 | 显示全部楼层
谢谢顽固不化
又学到一点点
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-25 02:08 , Processed in 0.073127 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表