本帖最后由 sellkingfly 于 2017-9-2 19:21 编辑
麻烦大家帮忙看下:
每点击一次生成按钮生成一个新按钮。
然后如何判断生成的哪个按钮被点击了。
下边???中间的语句怎么改才能实现呢?
多谢多谢!#include <GUIConstantsEx.au3>
Example()
Func Example()
; Create a GUI with various controls.
Local $hGUI = GUICreate("Example")
Local $idOK = GUICtrlCreateButton("create button", 310, 370, 85, 25)
; Display the GUI.
GUISetState(@SW_SHOW, $hGUI)
; Loop until the user exits.
Global $i = 1
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idOK
Assign('bb', 'b' & $i, 2)
Assign(Eval('bb'), GUICtrlCreateButton("button " & $i, 20, $i * 30, 80, 30))
$i = $i + 1
EndSwitch
;?????????????????????????????????????????????????????????????
For $j = 1 To 100
Assign('cc','b' & $j, 2)
Switch GUIGetMsg
Case Eval('cc')
MsgBox(0, '', 'you clicked button: ' & $j)
EndSwitch
Next
;?????????????????????????????????????????????????????????????
WEnd
; Delete the previous GUI and all controls.
GUIDelete($hGUI)
EndFunc ;==>Example
|