Function Reference


_GUICtrlRebar_AddBand

Adds a new band in a rebar control

#include <GuiReBar.au3>
_GUICtrlRebar_AddBand ( $hWndRebar, $hWndChild [, $iMinWidth = 100 [, $iDefaultWidth = 100 [, $sText = "" [, $iIndex = -1 [, $iStyle = -1]]]]] )

Parameters

$hWndRebar Handle to the rebar control
$hWndChild Handle of control to add
$iMinWidth [optional] Minimum width for the band
$iDefaultWidth [optional] Length of the band, in pixels
$sText [optional] Display text for the band
$iIndex [optional] 0-based index of the location where the band will be inserted.
If you set this parameter to -1, the control will add the new band at the last location
$iStyle [optional] Flags that specify the band style. This value can be a combination of the following:
    $RBBS_BREAK - The band is on a new line.
    $RBBS_CHILDEDGE - The band has an edge at the top and bottom of the child window.
    $RBBS_FIXEDBMP - The background bitmap does not move when the band is resized.
    $RBBS_FIXEDSIZE - The band can't be sized. With this style, the sizing grip is not displayed on the band.
    $RBBS_GRIPPERALWAYS - Version 4.71. The band will always have a sizing grip, even if it is the only band in the rebar.
    $RBBS_HIDDEN - The band will not be visible.
    $RBBS_NOGRIPPER - Version 4.71. The band will never have a sizing grip, even if there is more than one band in the rebar.
    $RBBS_USECHEVRON - Version 5.80. Show a chevron button if the band is smaller than cxIdeal.
    $RBBS_VARIABLEHEIGHT - Version 4.71. The band can be resized by the rebar control; cyIntegral and cyMaxChild affect how the rebar will resize the band.
    $RBBS_NOVERT - Don't show when vertical.
    $RBBS_USECHEVRON - Display drop-down button.
    $RBBS_HIDETITLE - Keep band title hidden.
    $RBBS_TOPALIGN - Keep band in top row.

Return Value

Success: True.
Failure: False.

Related

_GUICtrlRebar_AddToolBarBand, _GUICtrlRebar_DeleteBand

Example

#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
#include <GuiDateTimePicker.au3>
#include <GuiReBar.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
        Local $hGui, $idBtnExit, $hCombo, $hReBar, $hDTP, $idInput

        $hGui = GUICreate("Rebar", 400, 396, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX))

        ; create the rebar control
        $hReBar = _GUICtrlRebar_Create($hGui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS))

        ; create a combobox to put in the rebar
        $hCombo = _GUICtrlComboBox_Create($hGui, "", 0, 0, 120)

        _GUICtrlComboBox_BeginUpdate($hCombo)
        _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
        _GUICtrlComboBox_EndUpdate($hCombo)

        ; create a date time picker to put in the rebar
        $hDTP = _GUICtrlDTP_Create($hGui, 0, 0, 190)

        ; create a input box to put in the rebar
        $idInput = GUICtrlCreateInput("Input control", 0, 0, 120, 20)

        ; add band with control
        _GUICtrlRebar_AddBand($hReBar, $hCombo, 120, 200, "Dir *.exe")

        ; add and force to second row
        _GUICtrlRebar_AddBand($hReBar, $hDTP, 120)
        _GUICtrlRebar_SetBandStyleBreak($hReBar, 1)

        ; add to beginning of rebar
        _GUICtrlRebar_AddBand($hReBar, GUICtrlGetHandle($idInput), 120, 200, "Name:", 0)

        $idBtnExit = GUICtrlCreateButton("Exit", 150, 360, 100, 25)
        GUISetState(@SW_SHOW)

        While 1
                Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE, $idBtnExit
                                Exit
                EndSwitch
        WEnd
EndFunc   ;==>Example