求高手帮帮我解决下这个问题!
本帖最后由 qysir 于 2009-4-24 16:40 编辑部分代码---------
#NoTrayIcon
Dim $pzwj, $mc, $bb, $gs, $zz, $ck, $d, $rjmc, $rjsm, $i, $j, $zs, $ck, $bt, $nr, $xz, $az, $gy
$pzwj = ("setup.ini")
$ck = GuiCreate( "出品", 600, 488)
GuiCtrlCreateTab(0, 70, 600, 372)
for $j = 1 to 10
$d[$j] = IniRead($pzwj, "大类名称", $j, "没有")
if $d[$j] = "没有" then
else
GuiCtrlCreateTabItem($d[$j])
GuiCtrlCreateGroup("",5,86,140,350)
GuiCtrlCreateGroup("",143,86,452,350)
for $i = 1 to 100
$azwj = IniRead($pzwj, $i, "文件", "")
$rjmc = IniRead($pzwj, $i, "名称", "没有")
$rjsm = IniRead($pzwj, $i, "说明", "该软件没有说明信息")
$bt[$i] = IniRead($pzwj, $i, "标题" & $i, "没有找到内容")
$nr[$i] = IniRead($pzwj, $i, "内容" & $i, "没有找到内容")
if $j = Ceiling($i/10) then
if $rjmc = "没有" then
Else
$xz[$i] = GuiCtrlCreateCheckbox($rjmc, 14, 66+($i-($j-1)*10)*34)
GuiCtrlCreateLabel($rjsm, 151, 70+($i-($j-1)*10)*34)
endif
endif
next
endif
next
GuiCtrlCreateTabItem("")
GuiCtrlCreateProgress(15, 446, 361, 20)
if $xz <> 1 then
$az = GuiCtrlCreateButton("&S 安装", 390, 445, 60, 22)
Else
$az = GuiCtrlCreateButton("&S 安装", 390, 445, 60, 22)
GUICtrlSetState(-1, $GUI_DISABLE)
endif
我想实现 在没有选任何软件时按钮呈现无法点击状态,勾选后呈现可点击状态,我该怎么写呀? $button=GUICtrlCreateButton("&S 安 装",390,445,60,22)
GUICtrlSetState(-1,$GUI_DISABLE)
Global $check=0
while 1
$msg=GUIGetMsg()
For $i=1 To 10
If $msg=$xz[$i] Then
If BitAND(GUICtrlRead($xz[$i]),$GUI_CHECKED) Then
$check+=1
EndIf
If BitAND(GUICtrlRead($xz[$i]),$GUI_UNCHECKED) Then
$check-=1
EndIf
If $check<>0 Then
GUICtrlSetState($button,$GUI_ENABLE)
Else
GUICtrlSetState($button,$GUI_DISABLE)
EndIf
EndIf
Next
WEnd
我写了大概的 根据你的程序自己改改吧 非常感谢!!! 按你说的改了后无法实现呢,我要实现的是$xz[$i] = GuiCtrlCreateCheckbox($rjmc, 14, 66+($i-($j-1)*10)*34)
这个$xz[$i]默认=0,这时安装按钮呈现不能点击状态,当$xz[$i]=1时,安装按钮呈现能点击状态 本帖最后由 seominho 于 2009-4-24 14:57 编辑
$xz[$i] 是控件ID啊。。。。。。 无法实现哪一部分功能啊?? 把你改的代码上传看看 #include <GuiConstantsEx.au3>
#include <GuiStatusbar.au3>
#NoTrayIcon
Dim $pzwj, $mc, $bb, $gs, $zz, $ck, $d, $rjmc, $rjsm, $i, $j, $zs, $ck, $bt, $nr, $xz, $az, $gy
$pzwj = ("setup.ini")
$mc = IniRead($pzwj, "配置", "名称", "仿软件疯狂装")
$bb = IniRead($pzwj, "配置", "版本", "V2.0")
$gs = IniRead($pzwj, "配置", "公司", "青云网络")
$zz = IniRead($pzwj, "配置", "作者", "阿SIR")
$ck = GuiCreate($mc & $bb & " " & $gs & "" & $zz & "出品", 600, 488)
GuiCtrlCreateTab(0, 70, 600, 372)
for $j = 1 to 10
$d[$j] = IniRead($pzwj, "大类名称", $j, "没有")
if $d[$j] = "没有" then
else
GuiCtrlCreateTabItem($d[$j])
GuiCtrlCreateGroup("",5,86,140,350)
GuiCtrlCreateGroup("",143,86,452,350)
for $i = 1 to 100
$azwj = IniRead($pzwj, $i, "文件", "")
$rjmc = IniRead($pzwj, $i, "名称", "没有")
$rjsm = IniRead($pzwj, $i, "说明", "该软件没有说明信息")
$bt[$i] = IniRead($pzwj, $i, "标题" & $i, "没有找到内容")
$nr[$i] = IniRead($pzwj, $i, "内容" & $i, "没有找到内容")
if $j = Ceiling($i/10) then
if $rjmc = "没有" then
Else
$xz[$i] = GuiCtrlCreateCheckbox($rjmc, 14, 66+($i-($j-1)*10)*34)
GuiCtrlCreateLabel($rjsm, 151, 70+($i-($j-1)*10)*34)
endif
endif
next
endif
next
GuiCtrlCreateTabItem("")
GuiCtrlCreateProgress(15, 446, 361, 20)
$az = GuiCtrlCreateButton("&S 安装", 390, 445, 60, 22)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $check=0
$az = GuiCtrlCreateButton("&A 关于", 460, 445, 60, 22)
$tc = GuiCtrlCreateButton("&X 退出", 530, 445, 60, 22)
Local $a_PartsRightEdge =
Local $a_PartsText = [@TAB & $mc & $bb , @TAB & $gs & "" & $zz & "出品", @TAB & @YEAR & "." & @MON & "." & @MDAY]
_GUICtrlStatusBar_Create($ck, $a_PartsRightEdge, $a_PartsText)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $tc
Exit
For $i=1 To 100
If $msg=$xz[$i] Then
If BitAND(GUICtrlRead($xz[$i]),$GUI_CHECKED) Then
$check+=1
EndIf
If BitAND(GUICtrlRead($xz[$i]),$GUI_UNCHECKED) Then
$check-=1
EndIf
If $check <> 0 Then
GUICtrlSetState($button,$GUI_ENABLE)
Else
GUICtrlSetState($button,$GUI_DISABLE)
EndIf
EndIf
Next
EndSwitch
WEnd 本帖最后由 seominho 于 2009-4-24 16:18 编辑
EndSwitch写错地方了。。。。。。。还有上面$nMsg = GUIGetMsg()
$nMsg 改成$msg 或者把下面的$msg 改成$nMsg 写成一致 不一致当然运行不成功。。。。
这样写吧,别用 Switch
If $msg=$GUI_EVENT_CLOSE Or $msg=$tc Then
Exit
EndIf
For $i=1 To 100
If $msg=$xz[$i] Then
If BitAND(GUICtrlRead($xz[$i]),$GUI_CHECKED) Then
$check+=1
EndIf
If BitAND(GUICtrlRead($xz[$i]),$GUI_UNCHECKED) Then
$check-=1
EndIf
If $check <> 0 Then
GUICtrlSetState($button,$GUI_ENABLE)
Else
GUICtrlSetState($button,$GUI_DISABLE)
EndIf
EndIf
Next 本帖最后由 qysir 于 2009-4-24 21:04 编辑
终于知道错哪里了
#include <GuiConstantsEx.au3>
#include <GuiStatusbar.au3>
#NoTrayIcon
Dim $pzwj, $mc, $bb, $gs, $zz, $ck, $d, $rjmc, $rjsm, $i, $j, $zs, $ck, $bt, $nr, $xz, $az, $gy
$pzwj = ("setup.ini")
$mc = IniRead($pzwj, "配置", "名称", "仿软件疯狂装")
$bb = IniRead($pzwj, "配置", "版本", "V2.0")
$gs = IniRead($pzwj, "配置", "公司", "青云网络")
$zz = IniRead($pzwj, "配置", "作者", "阿SIR")
$ck = GuiCreate($mc & $bb & " " & $gs & "" & $zz & "出品", 600, 488)
GuiCtrlCreateTab(0, 70, 600, 372)
for $j = 1 to 10
$d[$j] = IniRead($pzwj, "大类名称", $j, "没有")
if $d[$j] = "没有" then
else
GuiCtrlCreateTabItem($d[$j])
GuiCtrlCreateGroup("",5,86,140,350)
GuiCtrlCreateGroup("",143,86,452,350)
for $i = 1 to 100
$azwj = IniRead($pzwj, $i, "文件", "")
$rjmc = IniRead($pzwj, $i, "名称", "没有")
$rjsm = IniRead($pzwj, $i, "说明", "该软件没有说明信息")
$bt[$i] = IniRead($pzwj, $i, "标题" & $i, "没有找到内容")
$nr[$i] = IniRead($pzwj, $i, "内容" & $i, "没有找到内容")
if $j = Ceiling($i/10) then
if $rjmc = "没有" then
Else
$xz[$i] = GuiCtrlCreateCheckbox($rjmc, 14, 66+($i-($j-1)*10)*34)
GuiCtrlCreateLabel($rjsm, 151, 70+($i-($j-1)*10)*34)
endif
endif
next
endif
next
GuiCtrlCreateTabItem("")
GuiCtrlCreateProgress(15, 446, 361, 20)
$az = GuiCtrlCreateButton("&S 安装", 390, 445, 60, 22)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $check=0
$gy = GuiCtrlCreateButton("&A 关于", 460, 445, 60, 22)
$tc = GuiCtrlCreateButton("&X 退出", 530, 445, 60, 22)
Local $a_PartsRightEdge =
Local $a_PartsText = [@TAB & $mc & $bb , @TAB & $gs & "" & $zz & "出品", @TAB & @YEAR & "." & @MON & "." & @MDAY]
_GUICtrlStatusBar_Create($ck, $a_PartsRightEdge, $a_PartsText)
GUISetState(@SW_SHOW)
while 1
$msg=GUIGetMsg()
For $i=1 To 10
If $msg=$xz[$i] Then
If BitAND(GUICtrlRead($xz[$i]),$GUI_CHECKED) Then
$check+=1
EndIf
If BitAND(GUICtrlRead($xz[$i]),$GUI_UNCHECKED) Then
$check-=1
EndIf
If $check<>0 Then
GUICtrlSetState($az,$GUI_ENABLE)
Else
GUICtrlSetState($az,$GUI_DISABLE)
EndIf
EndIf
Next
WEnd 本帖最后由 qysir 于 2009-4-24 21:05 编辑
For $i=1 To 10
这个部分的数字设大了会不停刷新,不知道这个问题能解决不,我现在取消了那个功能了,如果有请高手指点一二,万分感激
页:
[1]