本帖最后由 heroxianf 于 2016-5-19 08:44 编辑
下面是我测试的代码,我想通过$test的值与$test1进行对比,如果$test1包含在$test中就创建全部TAB控件,如果不包含就隐藏tab2。#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Local $test[5] = [1,2,3,4,5], $test1 = 9
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Tab1 = GUICtrlCreateTab(6, 72, 601, 361)
For $i = 0 To UBound($test) - 1
If $test[$i] = $test1 Then
GUICtrlCreateTabItem("111")
$Button1 = GUICtrlCreateButton("Button1", 264, 222, 75, 25)
GUICtrlCreateTabItem("222")
$Button2 = GUICtrlCreateButton("Button2", 264, 222, 75, 25)
GUICtrlCreateTabItem("333")
$Button3 = GUICtrlCreateButton("Button3", 264, 222, 75, 25)
ElseIf $test[$i] <> $test1 Then
Sleep(10)
EndIf
Next
GUICtrlCreateTabItem("111")
$Button1 = GUICtrlCreateButton("Button1", 264, 222, 75, 25)
GUICtrlCreateTabItem("333")
$Button3 = GUICtrlCreateButton("Button3", 264, 222, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
func Form1Close()
Exit
EndFunc
|