調(diào)整某個(gè)控件在窗口中的坐標(biāo)位置。
GUICtrlSetPos ( 控件ID, 左側(cè), 上方 [, 寬度 [, 高度]] )
參數(shù)
控件ID | 控件標(biāo)識(shí)符(控件ID),可由 GUICtrlCreate... 函數(shù)的返回值獲得。 |
左側(cè) | 控件左側(cè)的位置。 |
上方 | 控件上方的位置。 |
寬度 | [可選參數(shù)] 控件的寬度。 |
高度 | [可選參數(shù)] 控件的高度。 |
返回值
成功: | 返回值為1。 |
失敗: | 返回值為0。 |
注意
無
相關(guān)
GUICtrlCreate...
示例
#include <GUIConstants.au3>
GUICreate("我的 GUI 之控件定位") ; 創(chuàng)建一個(gè)居中顯示的窗口
$right = 0
$label=GUICtrlCreateLabel ( "會(huì)動(dòng)的 label", 10,20)
$button = GUICtrlCreateButton ("點(diǎn)擊此按鈕關(guān)閉窗口", 50,50)
GUICtrlSetState(-1,$GUI_FOCUS) ; 設(shè)置焦點(diǎn)到此按鈕上
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