Columns Property

Purpose

Returns or sets a value that determines whether a ListBox control scrolls vertically or horizontally and how the items in the columns are displayed. If it scrolls horizontally, the Columns property determines how many columns are displayed.

Syntax

object.Columns [= number]

Description

The settings for number are:

0( Default) Items are arranged in a single column and the ListBox scrolls vertically.

1 to n Items are arranged in snaking columns, filling the first column, then the second column, and so on. The ListBox scrolls horizontally and displays the specified number of columns.

Example

Local Int32 m, n

For n = 0 To 4

Ocx Label lbl(n) = "Columns =" & n, 10, (n * 70) + 10, 60, 60

Ocx ListBox lb(n) = n & " columns", 70, (n * 70) + 10, 200, 60 : lb(n).Columns = n

For m = 1 To 20 : lb(n).AddItem "Item " & Format(m, "00") : Next m

Next n

Do : Sleep : Until Me Is Nothing

Remarks

See Also

ListBox

{Created by Sjouke Hamstra; Last updated: 25/09/2014 by James Gaite}