本帖最后由 xwt620 于 2011-12-3 22:14 编辑
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $aParts[4] = [80, 160, 300, -1]
$Form1 = GUICreate("Form1", 623, 448, 192, 124)
$Button1 = GUICtrlCreateButton("按钮",0,0,50,20)
$hButton1 = GUICtrlGetHandle(-1)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
_GUICtrlStatusBar_SetParts($StatusBar1, $aParts)
_GUICtrlStatusBar_SetText($StatusBar1, "")
_GUICtrlStatusBar_SetText($StatusBar1, "部件 2", 1)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 21)
_GUICtrlStatusBar_EmbedControl($StatusBar1,0,$hButton1,3)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
运行代码,此时按钮1在part1的中间,最小化窗口再恢复窗口,看看 按钮1还是不是居中显示?
|