DesktopListBox.CellTextAt

From Xojo Documentation

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

DesktopListBox.CellTextAt(RowNumber as Integer, ColumnNumber as Integer = 0) As String

New in 2021r3

Supported for all project types and targets.

Used to get the text in a cell based on the row and column numbers passed.


Method

DesktopListBox.CellTextAt(RowNumber as Integer, ColumnNumber as Integer = 0, Assigns Text As String)

New in 2021r3

Supported for all project types and targets.

Used to set the text of the cell based on the row and column numbers passed.

Notes

The top-left cell is 0,0. The class constants AllColumns and AllRows can be used to specify that you wish to get or set all the values columns or rows. For example, the following specifies all columns in the last row added using AddRow or AddRowAt:

Me.CellTextAt(Me.LastAddedRowIndex, DesktopListBox.AllColumns)

If you set this equal to a tab-delimited string, you can update the row with one line of code.

Sample Code

In this example, the following code populates a two-column ListBox with the names of the controls in the window and their indexes.

Var i As Integer
For i = 0 To Self.ControlCount - 1 // number of controls in window
ListBox1.AddRow(Str(i)) // first column
ListBox1.CellTextAt(Listbox1.LastAddedRowIndex, 1) = Control(i).Name // second column
Next