在来一问,变量赋值问题
本帖最后由 xg911335 于 2009-7-21 13:50 编辑#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $x
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 167, 94, 192, 114)
$Input1 = GUICtrlCreateInput($x, 24, 16, 121, 21)
$Button1 = GUICtrlCreateButton("test", 40, 56, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
t()
EndSwitch
WEnd
Func t()
$t = "123"
$x = $t
EndFunc按下$Button1,func里面执行代码,怎样才能把func里面的结果传递给$Input1里的$x变量上? #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $x
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 167, 94, 192, 114)
$Input1 = GUICtrlCreateInput($x, 24, 16, 121, 21)
$Button1 = GUICtrlCreateButton("test", 40, 56, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
t()
EndSwitch
WEnd
Func t()
$t = "123"
GUICtrlSetData($Input1,$t)
EndFunc 非常感谢。
页:
[1]