Main Help →
GENerel Commmands →
SizeToFit Command
SizeToFit Command
The SizeToFit command adjusts the size of the current cell to fit its content
SizeToFit <#1>
where
- #1 is an optional padding to make the cell larger than needed to fit its content
or it can be -1. If it is -1, the cell will resize to fit to the content, but will be no wider then the size available on the current row. This use insures the cell will fit on the current row.
Notes
- This command works for all cells except for GroupBox cells. It must be called after setting all content of the cell (e.g., text, images, menu items, etc.) to get the correct size.
- Most cells adjust both width and height. These changes may cause elements to line up differently. If needed, you can realign the elements by setting their
offset property (available to all cells). Another options, which is most useful for TextCells, is to use tabwidth 0 to resize width of the cell without changing its height.
- For TextCells and ButtonCells, the padding is added only to the width direction.
- For TextField cells, the width will remain the same and the height will be adjusted to display all the text. Any padding will be added to the height. The resulting height can be restricted by setting the
MinHeight and MaxHeight properties of the TextField cell. The default minimum height is 44 which is the minimum needed to properly display a vertical scroll bar. The default maximum height is unlimited.
- For PopupMenuEdit cells, only the width will be adjusted and it will be set to displayed the longest menu item. Any padding will be added to the width.
- Padding is ignored for PaneBar cells.