Class

# DesktopListBoxColumn

<div class="rst-class">

forsearch

</div>

Listbox

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to refer to a particular column in a `DesktopListBox</api/user_interface/desktop/desktoplistbox>` via its ColumnAttributesAt property.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                          | Type                               | Read-Only | Shared |
|---------------------------------------------------------------|------------------------------------|-----------|--------|
| `MaxWidthActual<desktoplistboxcolumn.maxwidthactual>`         | `Integer</api/data_types/integer>` |           |        |
| `MaxWidthExpression<desktoplistboxcolumn.maxwidthexpression>` | `String</api/data_types/string>`   |           |        |
| `MinWidthActual<desktoplistboxcolumn.minwidthactual>`         | `Integer</api/data_types/integer>` |           |        |
| `MinWidthExpression<desktoplistboxcolumn.minwidthexpression>` | `String</api/data_types/string>`   |           |        |
| `UserResizable<desktoplistboxcolumn.userresizable>`           | `Boolean</api/data_types/boolean>` |           |        |
| `WidthActual<desktoplistboxcolumn.widthactual>`               | `Integer</api/data_types/integer>` |           |        |
| `WidthExpression<desktoplistboxcolumn.widthexpression>`       | `String</api/data_types/string>`   |           |        |

## Property descriptions

<div id="desktoplistboxcolumn.maxwidthactual">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.MaxWidthActual

**MaxWidthActual** As `Integer</api/data_types/integer>`

> The maximum width of the column (points).
>
> The following example sets the maximum width for the first three columns.
>
> ``` xojo
> Me.ColumnAttributesAt(0).MaxWidthActual = 80
> Me.ColumnAttributesAt(1).MaxWidthActual = 80
> Me.ColumnAttributesAt(2).MaxWidthActual = 45
> ```

<div id="desktoplistboxcolumn.maxwidthexpression">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.MaxWidthExpression

**MaxWidthExpression** As `String</api/data_types/string>`

> The maximum width of the column as a string expression that can include spaces and the percent sign.
>
> To set column widths, you can use a mixture of pixels, percentages, and relative lengths. Column widths specified in pixels are guaranteed to have the specified width with the user resizes the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` or resizable columns. Column widths specified in percentages are guaranteed to have that percentage of the visible width of the `DesktopListBox</api/user_interface/desktop/desktoplistbox>`. The column widths specified using the "*" divide up the remaining width proportionally. Using the "*" as the last column width, assigns all of the remaining width to the last column. Resizing a column will resize the value of the expression. If you resize the `DesktopListBox</api/user_interface/desktop/desktoplistbox>`, both the percentage and relative lengths recompute their actual widths. There are two resizing "modes"; for more information, see `Resizing Columns</api/user_interface/desktop/desktoplistbox/resizing_columns>`.
>
> If there are three columns, the specification:
>
> ``` xojo
> Listbox1.ColumnAttributesAt(0).MaxWidthExpression = "3*"
> Listbox1.ColumnAttributesAt(1).MaxWidthExpression = "*"
> Listbox1.ColumnAttributesAt(2).MaxWidthExpression = "10"
> ```

<div id="desktoplistboxcolumn.minwidthactual">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.MinWidthActual

**MinWidthActual** As `Integer</api/data_types/integer>`

> The minimum width of the column (points).
>
> The following example sets the minimum widths of the first three columns.
>
> ``` xojo
> Me.ColumnAttributesAt(0).MinWidthActual = 40
> Me.ColumnAttributesAt(1).MinWidthActual = 30
> Me.ColumnAttributesAt(2).MinWidthActual = 20
> ```

<div id="desktoplistboxcolumn.minwidthexpression">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.MinWidthExpression

**MinWidthExpression** As `String</api/data_types/string>`

> The minimum width of the column as a string expression that can include spaces and the percent sign.
>
> The following line sets the minimum width of the first column in a `DesktopListBox</api/user_interface/desktop/desktoplistbox>` to 15% of the total width of the ListBox.
>
> ``` xojo
> Listbox1.ColumnAttributesAt(0).MinWidthExpression = "15%"
> ```

<div id="desktoplistboxcolumn.userresizable">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.UserResizable

**UserResizable** As `Boolean</api/data_types/boolean>`

> `True</api/language/true>` if the column is resizable; the default is `False</api/language/false>`.
>
> The following line in the Opening event of a `DesktopListBox</api/user_interface/desktop/desktoplistbox>` makes all the columns in the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` resizable:
>
> ``` xojo
> Me.ColumnAttributesAt(-1).UserResizable = True
>
> ' or use the pre-defined DesktopListBox constant
> Me.ColumnAttributesAt(DesktopListBox.AllColumns).UserResizable = True
> ```

<div id="desktoplistboxcolumn.widthactual">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.WidthActual

**WidthActual** As `Integer</api/data_types/integer>`

> The width of the column in pixels.
>
> This example sets the size of the first three columns in a `DesktopListBox</api/user_interface/desktop/desktoplistbox>`.
>
> ``` xojo
> Me.ColumnAttributesAt(0).WidthActual = 80
> Me.ColumnAttributesAt(1).WidthActual = 80
> Me.ColumnAttributesAt(2).WidthActual = 45
> ```

<div id="desktoplistboxcolumn.widthexpression">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DesktopListBoxColumn.WidthExpression

**WidthExpression** As `String</api/data_types/string>`

> Column width as a string expression that can include the percent sign, a decimal point, or blanks.
>
> Width can be specified as a value in pixels, a percentage, or a relative length. To obtain the absolute width of a column specified using percent or a relative length, call WidthActual. If you use \* or %, the actual width will vary as the width of the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` changes.
>
> To set column widths, you can use a mixture of pixels, percentages, and relative lengths. Column widths specified in pixels are guaranteed to have the specified width with the user resizes the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` or resizable columns. Column widths specified in percentages are guaranteed to have that percentage of the visible width of the `DesktopListBox</api/user_interface/desktop/desktoplistbox>`. The column widths specified using the "*" divide up the remaining width proportionally. Using the "*" as the last column width, assigns all of the remaining width to the last column. Resizing a column will resize the value of the expression. If you resize the `DesktopListBox</api/user_interface/desktop/desktoplistbox>`, both the percentage and relative lengths recompute their actual widths. There are two resizing "modes"; for more information, see `Resizing Columns</api/user_interface/desktop/desktoplistbox/resizing_columns>` in the documentation for the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` control.
>
> For example, if there are three columns, the specification:
>
> ``` xojo
> Listbox1.ColumnAttributesAt(0).WidthExpression = "3*"
> Listbox1.ColumnAttributesAt(1).WidthExpression = "*"
> Listbox1.ColumnAttributesAt(2).WidthExpression = "10"
> ```

## Notes

Use the `UserResizable` property to set the property, e.g.,

``` xojo
ListBox1.ColumnAttributesAt(1).UserResizable = False
```

To set column widths, you can use a mixture of pixels, percentages, and relative lengths. Column widths specified in pixels are guaranteed to have the specified width with the user resizes the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` or resizable columns. Column widths specified in percentages are guaranteed to have that percentage of the visible width of the `DesktopListBox</api/user_interface/desktop/desktoplistbox>`. The column widths specified using the "*" divide up the remaining width proportionally. Using the "*" as the last column width, assigns all of the remaining width to the last column. Resizing a column will resize the value of the expression. If you resize the `ListBox</api/user_interface/desktop/desktoplistbox>`, both the percentage and relative lengths recompute their actual widths. There are two resizing "modes"; for more information, see `Resizing Columns</api/user_interface/desktop/desktoplistbox/resizing_columns>` in the documentation for the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` control.

For example, if there are three columns, the specification:

``` xojo
Listbox1.ColumnAttributesAt(0).WidthExpression = "3*"
Listbox1.ColumnAttributesAt(1).WidthExpression = "*"
Listbox1.ColumnAttributesAt(2).WidthExpression = "10"
```

allocates a fixed amount of space to Column 2. There remaining width is divided up into four segments and allocates it between Columns 0 and 1 in the ratio of 3 to 1. This means that Column 0 gets the width of the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` minus 10 times 3/4, Column 1 gets the width of the `ListBox</api/user_interface/desktop/desktoplistbox>` minus 10 times 1/4, and Column 2 gets 10 pixels. As the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` changes in size (due to a window resize, for example) columns 0 and 1 will change to reflect that growth, while column 2 will not.

Header End caps are added for any additional unused space if headers are used. Header end caps do nothing when clicked.

If the string expression passed to `WidthExpression`, `MinWidthExpression`, or `MaxWidthExpression` cannot be evaluated to a width or a percentage width, an `UnsupportedFormatException</api/exceptions/unsupportedformatexception>` will occur. The Message property of this exception describes in English what went wrong.

## Sample code

The following line in the Opening event of a `DesktopListBox</api/user_interface/desktop/desktoplistbox>` makes all the columns in the `DesktopListBox</api/user_interface/desktop/desktoplistbox>` resizable:

``` xojo
Me.ColumnAttributesAt(-1).UserResizable = True

' or use the pre-defined DesktopListBox constant
Me.ColumnAttributesAt(DesktopListBox.AllColumns).UserResizable = True
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The following line sets the maximum width of the first column in a `DesktopListBox</api/user_interface/desktop/desktoplistbox>` to 75% of the total width of the ListBox.

``` xojo
Listbox1.ColumnAttributesAt(0).MaxWidthExpression = "75%"
```

## Compatibility

|                       |         |
|-----------------------|---------|
| **Project Types**     | Desktop |
| **Operating Systems** | All     |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `DesktopListBox</api/user_interface/desktop/desktoplistbox>` class.

</div>
