調(diào)整控件在窗口中的位置.
GUICtrlSetPos ( 控件ID, 左距, 頂距 [, 寬度 [, 高度]]]
)
控件ID | 由 GUICtrlCreate... 函數(shù)返回的控件標識符. |
左距 | 控件的左側位置. |
頂距 | [可選參數(shù)] 控件的上方位置. |
寬度 | [可選參數(shù)] 控件的寬度. |
高度 | [可選參數(shù)] 控件的高度. |
成功: | 返回 1. |
失敗: | 返回 0. |
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local
$right,
$label,
$button,
$msg
GUICreate("我的狀態(tài) GUI") ;
創(chuàng)建居中顯示的 GUI 窗口
$right = 0
$label = GUICtrlCreateLabel("我的移到標記控件", 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
EndFunc ;==>Example
provider with jb51.net (unicode) |