DesktopListBox.HeaderAt

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As String )
aDesktopListBox.HeaderAt(index as integer) = newStringValue
or
StringValue = aDesktopListBox.HeaderAt(index as integer)

New in 2021r3

Supported for all project types and targets.

An array of column headings. Headings appear only if HasHeader is True.

Notes

If you assign values to both HeaderAt and InitialValue, the first row of InitialValue is interpreted as the first row of data; otherwise, it is used as the header and the second row of InitialValue is used as the first row of data.

You can set the headers in a multi-column listbox by assigning to HeaderAt(DesktopListBox.AllColumns) the text of the headings separated by the tab character, e.g.,

Me.HeaderAt(ListBox.AllColumns) = "FirstName" + Chr(9) + "LastName"

You must use a space if you want an empty header; empty strings will use the default header.

ListBox1.HeaderAt(ListBox.AllColumns) = "" // sets all headers of ListBox1 to their defaults.
ListBox1.HeaderAt(5) = "" // sets column 5's header to its default heading
ListBox1.HeaderAt(5) = " " // sets column 5's header to empty.

Example

This example populates a three-column ListBox with headers:

ListBox1.HasHeader = True
ListBox1.HeaderAt(0) = "ID"
ListBox1.HeaderAt(1) = "JobTitle"
ListBox1.HeaderAt(2) = "Name"

See Also

DesktopListBox.HasHeader property