UserGuide

Desktop List Box

From Xojo Documentation

A ListBox displays information in one or more columns and can be scrollable. Data can also be displayed in a hierarchical format.

Properties

AllowExpandableRows - Allows the ListBox to have rows that can be expanded to show children (for rows added using AddExpandableRow).

AllowFocusRing - Indicates if the focus ring is drawn around the ListBox.

AllowResizableColumns - Indicates that columns can be resized by the user by dragging the separator in the column header. The ListBox must have a header in order for the columns to be resizable.

AllowRowDragging, AllowRowReordering - Enables row dragging, dropping and reordering.

AllowAutoHideScrollbars - Used to hide the scrollbars until they are needed.

Using the ListBox

HasBorder - Specifies if the border appears or not.

CellAlignmentAt, CellAlignmentOffsetAt - Used to specify cell alignments for specific cells (Default, Left, Center, Right, Decimal via the DesktopListBox.Alignments enumeration). Use CellAlignmentOffset (or ColumnAlignmentOffsetAt) to control alignment for decimal values.

CellCheckBoxValueAt - Used to check or uncheck a checkbox that is in a cell.

CellTypeAt, ColumnTypeAt - Specifies the type of a cell or column via the CellTypes enumeration. Values are: Default, Normal, CheckBox, TextField, TextArea.

ColumnAttributesAt - Provides access to the ListColumn class to alter column-specific properties such as widths and resizability.

ColumnAlignmentAt, ColumnAlignmentOffsetAt - Used to specify cell alignments for a column via the Alignments enumeration. Values are: Default, Left, Center, Right, Decimal). Use ColumnAlignmentAt (or ColumnAlignmentOffsetAt) to control alignment for decimal values.

ColumnCount - The number of columns.

ColumnSortDirectionAt - Controls the sort direction for a column via the SortDirections enumeration. Values are: Descending, None, Ascending.

ColumnWidths - A text string that specifies the widths to use for all the columns. You can specify widths as fixed pixel sizes, percentages or even calculations.

DefaultRowHeight - The default row height for all the rows. All rows always have the same height.

GridLines - Specifies the type of grid lines to use via the GridLineStyles enumeration.

HasHeader - Indicates that the ListBox should have a header. A header is required in order to sort and resize columns.

HeaderAt - When HasHeader is True, returns the header at the index passed.

InitialValue - A list of the initial values displayed in the List Box. Separate columns using tab characters. When HasHeading is True, the first row is the name of the headings.

LastRowIndex - The last row added to the List Box by AddRow, AddExpandableRow, AddRowAt or AddExpandableRowAt.

SelectedRowIndex - The currently selected row in the ListBox. Returns -1 when no row is selected.

RequiresSelection - When True, a row remains selected even when the user clicks on an empty area of the ListBox.

RowCount - The number of rows in the ListBox.

ScrollPosition, ScrollPositionX - Controls the vertical and horizontal scroll positions.

SelectedRowCount - If multiple selections are allowed, SelectedRowCount returns the number of selected rows.

RowSelectionType - Specifies whether to allow single or multiple row selection via the RowSelectionTypes enumeration. Values are: Single and Multiple.

SortingColumn - Specifies the current sort column, but does not sort the data (call the Sort method).

SelectedRowValue - The value of the first column of the currently selected row.

Methods

CellTagAt, ColumnTagAt, RowTagAt - Used to get or set the tag value (a Variant) for a specific cell, column or row.

RowExpandedAt - For hierarchical ListBoxes, indicates if the specified folder row is currently expanded.