Sets the number of parts and the part edges
#include <GuiStatusBar.au3>
_GUICtrlStatusBar_SetParts ( $hWnd [, $aParts = -1 [, $aPartWidth = 25]] )
$hWnd | Handle to the control |
$aParts | [optional] Number of parts, can be an 0-based array of ints in the following format: $aParts[0] - Right edge of part #1 $aParts[1] - Right edge of part #2 $aParts[n] - Right edge of part n |
$aPartWidth | [optional] Size of parts, can be an 0-based array of ints in the following format: $aPartWidth[0] - width part #1 $aPartWidth[1] - width of part #2 $aPartWidth[n] - width of part n |
Success: | True. |
Failure: | False. |
If an element is -1, the right edge of the corresponding part extends to the border of the window.
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
Local $hGUI, $hStatus
Local $aParts[3] = [75, 150, -1]
; Create GUI
$hGUI = GUICreate("StatusBar Set Parts", 400, 300)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
; Create memo control
$g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUISetState(@SW_SHOW)
; Set/Get parts
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
$aParts = _GUICtrlStatusBar_GetParts($hStatus)
For $iI = 1 To $aParts[0]
MemoWrite("Part " & $iI & " width .: " & $aParts[$iI])
Next
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
; Write message to memo
Func MemoWrite($sMessage = "")
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite