Function Reference


_GUICtrlRebar_AddToolBarBand

Adds a new band in a rebar control

#include <GuiReBar.au3>
_GUICtrlRebar_AddToolBarBand ( $hWndRebar, $hWndToolbar [, $sText = "" [, $iIndex = -1 [, $iStyle = -1]]] )

Parameters

$hWndRebar Handle to the rebar control
$hWndToolbar Handle of the Toolbar control to add
$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_AddBand, _GUICtrlRebar_DeleteBand

Example

#include <GUIConstantsEx.au3>
#include <GuiReBar.au3>
#include <GuiToolbar.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    Local $hGui, $idBtnExit, $hToolbar, $hReBar, $idInput
    Local Enum $e_idNew = 1000, $e_idOpen, $e_idSave, $idHelp

    $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 toolbar to put in the rebar
    $hToolbar = _GUICtrlToolbar_Create($hGui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN))

    ; Add standard system bitmaps
    Switch _GUICtrlToolbar_GetBitmapFlags($hToolbar)
        Case 0
            _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
        Case 2
            _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
    EndSwitch

    ; Add buttons
    _GUICtrlToolbar_AddButton($hToolbar, $e_idNew, $STD_FILENEW)
    _GUICtrlToolbar_AddButton($hToolbar, $e_idOpen, $STD_FILEOPEN)
    _GUICtrlToolbar_AddButton($hToolbar, $e_idSave, $STD_FILESAVE)
    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)

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

    ;add band containing the control
    _GUICtrlRebar_AddBand($hReBar, GUICtrlGetHandle($idInput), 120, 200, "Name:")

    ; add band containing the control to beginning of rebar
    _GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "", 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