[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TToolBar.WrapButtons

Adjusts tool button sizes and positions, and handles wrapping to new rows or columns.

## Declaration

Source position: comctrls.pp line 2352

`protected function TToolBar.WrapButtons(`
`UseSize: Integer;`
`out NewWidth: Integer;`
`out NewHeight: Integer;`
`Simulate: Boolean`
`):Boolean;`

## Arguments

`UseSize` |  | Size requested for the tool buttons (height for vertical orientation, width for horizontal orientation).
`NewWidth` |  | Returns the new width calculated for the buttons.
`NewHeight` |  | Returns the new height calculated for the buttons.
`Simulate` |  | True when the tool button sizes are being recalculated but not actually drawn on the control.

## Function result

Always returns True in WrapButtons.

## Description

WrapButtons is a Boolean function used to resize and position buttons on the tool bar. WrapButtons positions buttons from left to right in the client display area, and repositions any child control with its Align property set to clNone.

When Simulate is True, the child control sizes and positions are calculated but not applied to the tool bar.

Set Wrapable to True to allow a new row or column to be created when the cumulative button width is larger than the width for the tool bar. Or set the Wrap property in a specific tool button to True to force it and subsequent controls onto a new row.