调整某个控件在窗口中的坐标位置。
GUICtrlSetPos ( 控件ID, 左侧, 上方 [, 宽度 [, 高度]] )
参数
控件ID | 控件标识符(控件ID),可由 GUICtrlCreate... 函数的返回值获得。 |
左侧 | 控件左侧的位置。 |
上方 | 控件上方的位置。 |
宽度 | [可选参数] 控件的宽度。 |
高度 | [可选参数] 控件的高度。 |
返回值
成功: | 返回值为1。 |
失败: | 返回值为0。 |
注意
无
相关
GUICtrlCreate...
示例
#include <GUIConstants.au3>
GUICreate("我的 GUI 之控件定位") ; 创建一个居中显示的窗口
$right = 0
$label=GUICtrlCreateLabel ( "会动的 label", 10,20)
$button = GUICtrlCreateButton ("点击此按钮关闭窗口", 50,50)
GUICtrlSetState(-1,$GUI_FOCUS) ; 设置焦点到此按钮上
GUISetState ()
While 1
$msg = GUIGetMsg()
if $msg = $button Or $msg = $GUI_EVENT_CLOSE then Exit
If $right = 0 then
$right = 1
GUICtrlSetPos ($label, 20,20)
else
$right = 0
GUICtrlSetPos ($label, 10,20)
endif
Sleep(100)
Wend