本帖最后由 afan 于 2010-6-27 01:24 编辑
换个角度看问题GUICreate("GUI", 600, 400)
$tab = GUICtrlCreateTab(2, 2, 596, 396)
$tab0 = GUICtrlCreateTabItem("TAB0")
GUICtrlCreateLabel("请输入数量:", 40, 40, 100, 20);, $SS_RIGHT)
$minhand = GUICtrlCreateInput("", 150, 35, 200, 20)
$tab1OK = GUICtrlCreateButton("确定", 220, 100, 80, 50)
$tab1 = GUICtrlCreateTabItem("TAB1")
Dim $Label[21]
For $i = 1 To 20 ;你准备如何自动生成Label可在此先创建出来
$Label[$i] = GUICtrlCreateLabel("Label " & $i, 40, 20 + 17 * $i)
GUICtrlSetState(-1, 32)
Next
GUICtrlCreateTabItem("")
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = -3
Exit
Case $msg = $tab1OK
$zs = GUICtrlRead($minhand)
If $zs > 20 Then MsgBox(0, 0, '限制最多设置20,多出部分将无效')
For $i = 1 To 20
If $i <= $zs Then GUICtrlSetState($Label[$i], 16)
If $i > $zs Then GUICtrlSetState($Label[$i], 32)
Next
EndSelect
WEnd
|