程序中动态新建的按钮,如何在gui中被选中
如:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <user_function.au3>
#Region ### START Koda GUI section ### Form=D:\auto_check_up\Form2.kxf
$Form1 = GUICreate("自动检测文件配置工具", 555, 277, 192, 124)
Dim $TabSheet[1],$Label_se[1],$Label_se_dir[1],$Button_se[1],$Label_de[1],$Label_de_dir[1],$Button_de[1],$Label_url[1],$In_url[1]
$Tab1 = GUICtrlCreateTab(24, 32, 513, 185)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet[0] = GUICtrlCreateTabItem("第1页")
$Label_se[0] = GUICtrlCreateLabel("源数据目录:", 40, 80, 90, 17)
$Label_se_dir[0] = GUICtrlCreateLabel("", 138, 80, 314, 17)
$Button_se[0] = GUICtrlCreateButton("dir", 464, 80, 33, 17, $WS_GROUP)
$Label_de[0] = GUICtrlCreateLabel("目的数据目录:", 40, 120, 90, 17)
$Label_de_dir[0] = GUICtrlCreateLabel("", 138, 120, 314, 17)
$Button_de[0] = GUICtrlCreateButton("dir", 464, 120, 33, 17, $WS_GROUP)
$Label_url[0] = GUICtrlCreateLabel("导入程序url:", 40, 160, 90, 17)
$In_url[0] = GUICtrlCreateInput("", 138, 160, 375, 21)
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("保存", 344, 232, 89, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("退出", 448, 232, 81, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("+++", 416, 32, 41, 17, $WS_GROUP)
$Button4 = GUICtrlCreateButton("---", 472, 32, 41, 17, $WS_GROUP)
$In_sec = GUICtrlCreateInput("", 160, 232, 65, 21)
$Label5 = GUICtrlCreateLabel("监测时间间隔(秒):", 32, 232, 113, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Case $Button2
Exit
Case $Button3
;$TabSheet[1],$Label_se[1],$Label_se_dir[1],$Button_se[1],$Label_de[1],$Label_de_dir[1],$Button_de[1],$Label_url[1],$In_url[1]
ReDim $TabSheet[UBound($TabSheet) + 1]
ReDim $Label_se[UBound($Label_se) + 1]
ReDim $Label_se_dir[UBound($Label_se_dir) + 1]
ReDim $Button_se[UBound($Label_se) + 1]
ReDim $Label_de[UBound($Label_se) + 1]
ReDim $Label_de_dir[UBound($Label_se) + 1]
ReDim $Button_de[UBound($Label_se) + 1]
ReDim $Label_url[UBound($Label_se) + 1]
ReDim $In_url[UBound($Label_se) + 1]
$TabSheet[UBound($TabSheet) - 1] = GUICtrlCreateTabItem("第"&UBound($TabSheet)&"页")
$Label_se[UBound($TabSheet) - 1] = GUICtrlCreateLabel("源数据目录:", 40, 80, 90, 17)
$Label_se_dir[UBound($TabSheet) - 1] = GUICtrlCreateLabel("", 138, 80, 314, 17)
$Button_se[UBound($TabSheet) - 1] = GUICtrlCreateButton("dir", 464, 80, 33, 17, $WS_GROUP)
$Label_de[UBound($TabSheet) - 1] = GUICtrlCreateLabel("目的数据目录:", 40, 120, 90, 17)
$Label_de_dir[UBound($TabSheet) - 1] = GUICtrlCreateLabel("", 138, 120, 314, 17)
$Button_de[UBound($TabSheet) - 1] = GUICtrlCreateButton("dir", 464, 120, 33, 17, $WS_GROUP)
$Label_url[UBound($TabSheet) - 1] = GUICtrlCreateLabel("导入程序url:", 40, 160, 90, 17)
$In_url[UBound($TabSheet) - 1] = GUICtrlCreateInput("", 138, 160, 375, 21)
Case $Button_se[0]
$msg=_FileSelectFolder("源目录")
GUICtrlSetData($Label_se_dir[0],$msg)
Case $Button_de[0]
$msg=_FileSelectFolder("目标目录")
GUICtrlSetData($Label_de_dir[0],$msg)
EndSwitch
WEnd
case $button_se[1]
???
怎么增加?
[ 本帖最后由 qingting 于 2009-4-9 12:07 编辑 ] |