Class

# PDFListBox

<div class="rst-class">

forsearch

</div>

PDF

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

## Description

A standard list box that can be embedded into a `PDFDocument</api/pdf/pdfdocument>`.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                              | Type                                              | Read-Only | Shared |
|---------------------------------------------------|---------------------------------------------------|-----------|--------|
| `FontSize<pdflistbox.fontsize>`                   | `Integer</api/data_types/integer>`                |           |        |
| `Height<pdflistbox.height>`                       | `Integer</api/data_types/integer>`                |           |        |
| `IsSorted<pdflistbox.issorted>`                   | `Boolean</api/data_types/boolean>`                |           |        |
| `LastAddedRowIndex<pdflistbox.lastaddedrowindex>` | `Integer</api/data_types/integer>`                | ✓         |        |
| `LastRowIndex<pdflistbox.lastrowindex>`           | `Integer</api/data_types/integer>`                | ✓         |        |
| `Name<pdflistbox.name>`                           | `String</api/data_types/string>`                  |           |        |
| `Page<pdflistbox.page>`                           | `Integer</api/data_types/integer>`                | ✓         |        |
| `RowCount<pdflistbox.rowcount>`                   | `Integer</api/data_types/integer>`                | ✓         |        |
| `RowSelectionType<pdflistbox.rowselectiontype>`   | `RowSelectionTypes<pdflistbox.rowselectiontypes>` |           |        |
| `SelectedRowIndex<pdflistbox.selectedrowindex>`   | `Integer</api/data_types/integer>`                |           |        |
| `SelectedRowText<pdflistbox.selectedrowtext>`     | `String</api/data_types/string>`                  | ✓         |        |
| `Width<pdflistbox.width>`                         | `Integer</api/data_types/integer>`                |           |        |
| `X<pdflistbox.x>`                                 | `Integer</api/data_types/integer>`                |           |        |
| `Y<pdflistbox.y>`                                 | `Integer</api/data_types/integer>`                |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters                                                                                                                                                                                                                                                                                                                                                   | Returns                            | Shared |
|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|--------|
| `AddAllRows<pdflistbox.addallrows>`       | items() As `String</api/data_types/string>`                                                                                                                                                                                                                                                                                                                  |                                    |        |
| `AddRow<pdflistbox.addrow>`               | item As `String</api/data_types/string>`                                                                                                                                                                                                                                                                                                                     |                                    |        |
| `AddRowAt<pdflistbox.addrowat>`           | index As `Integer</api/data_types/integer>`, Item As `String</api/data_types/string>`                                                                                                                                                                                                                                                                        |                                    |        |
| `Constructor<pdflistbox.constructor0>`    | pageNumber As `Integer</api/data_types/integer>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, name As `String</api/data_types/string>`, `ParamArray</api/language/paramarray>` values() As `String</api/data_types/string>` |                                    |        |
| `Constructor<pdflistbox.constructor1>`    | pageNumber As `Integer</api/data_types/integer>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, name As `String</api/data_types/string>`, values() As `String</api/data_types/string>`                                        |                                    |        |
| `RemoveAllRows<pdflistbox.removeallrows>` |                                                                                                                                                                                                                                                                                                                                                              |                                    |        |
| `RemoveRowAt<pdflistbox.removerowat>`     | index As `Integer</api/data_types/integer>`                                                                                                                                                                                                                                                                                                                  |                                    |        |
| `Rows<pdflistbox.rows>`                   |                                                                                                                                                                                                                                                                                                                                                              | `String()</api/data_types/string>` |        |

## Enumerations

<div id="pdflistbox.rowselectiontypes">

<div class="rst-class">

forsearch

</div>

</div>

PDFListBox.RowSelectionTypes

### RowSelectionTypes

> The types of row selection possible.
>
> | Enum     | Description                                          |
> |----------|------------------------------------------------------|
> | Single   | Only one row is selectable at a time.                |
> | Multiple | Any number of rows may be selected at the same time. |

## Property descriptions

<div id="pdflistbox.fontsize">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.FontSize

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

> The size of the text of the control.

<div id="pdflistbox.height">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Height

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

> The height of the control.

<div id="pdflistbox.issorted">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.IsSorted

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

> When set to `True</api/language/true>`, the data is sorted in ascending order.

<div id="pdflistbox.lastaddedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.LastAddedRowIndex

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

> The number of the last row added with the AddRow, AddAllRows or AddRowAt method. If no rows have been added, LastAddedRowIndex will be -1.
>
> This property is read-only.
>
> This example displays the value of the last row added to the \`PDFListBox\`:
>
> ``` xojo
> Var r As Integer = MyPDFListbox.LastAddedRowIndex
> System.Beep
> MessageBox("The last value added was: " + MyPDFListbox.RowTextAt(r))
> ```

<div id="pdflistbox.lastrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.LastRowIndex

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

> The number of the last row of the <span class="title-ref">PDFListBox</span>.
>
> This property is read-only.
>
> This value will be 1 less than the `PDFListBox<pdflistbox.rowcount>`.

<div id="pdflistbox.name">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Name

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

> The name of the control.

<div id="pdflistbox.page">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Page

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

> The number of the page upon which the control was created.
>
> This property is read-only.

<div id="pdflistbox.rowcount">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.RowCount

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

> The number of rows in the listbox.
>
> This property is read-only.
>
> This example displays the number of rows in the listbox.
>
> ``` xojo
> MessageBox(FruitList.RowCount.ToString)
> ```

<div id="pdflistbox.rowselectiontype">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.RowSelectionType

**RowSelectionType** As `RowSelectionTypes<pdflistbox.rowselectiontypes>`

> Indicates the type of row selection allowed via mouse gestures.
>
> The type of allowed row selection is set via `PDFListBox<pdflistbox.rowselectiontypes>`.
>
> The default is single-row selection.

<div id="pdflistbox.selectedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.SelectedRowIndex

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

> Used to get or set the selected item number. The first item is zero.
>
> A value of -1 means no selection. SelectedRowIndex may be set using the Properties pane to set the default value of <span class="title-ref">PDFListBox</span> control.
>
> The following example changes the selected item to the third item:
>
> ``` xojo
> FruitList.SelectedRowIndex = 2
> ```

<div id="pdflistbox.selectedrowtext">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.SelectedRowText

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

> The text of the currently selected row.
>
> This property is read-only.
>
> This example displays the value of the currently selected item in a `DesktopTextField</api/user_interface/desktop/desktoptextfield>`.
>
> ``` xojo
> UserName.Text = PDFdoc.UserList.SelectedRowText
> ```

<div id="pdflistbox.width">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Width

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

> The width of the control.

<div id="pdflistbox.x">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.X

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

> The location on the X axis of the upper-left corner of the control.

<div id="pdflistbox.y">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Y

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

> The location on the Y axis of the upper-left corner of the control.

## Method descriptions

<div id="pdflistbox.addallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.AddAllRows

**AddAllRows**(items() As `String</api/data_types/string>`)

> Appends the elements of the array to the items in the listbox.
>
> The following example adds two items to the menu. It is equivalent to the example for `AddRow<pdflistbox.addrow>` that calls AddRow repeatedly.
>
> ``` xojo
> ListBox1.AddAllRows("Banana", "Orange")
> ```

<div id="pdflistbox.addrow">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.AddRow

**AddRow**(item As `String</api/data_types/string>`)

> Appends *item* in a new row to the end of the list.

<div id="pdflistbox.addrowat">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.AddRowAt

**AddRowAt**(index As `Integer</api/data_types/integer>`, Item As `String</api/data_types/string>`)

> Creates a new row at *index* (moving the existing rows down). The first row is numbered 0.
>
> The following example adds a row at the 4th position.
>
> ``` xojo
> ListBox1.AddRowAt(3,"Harry")
> ```

<div id="pdflistbox.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Constructor

**Constructor**(pageNumber As `Integer</api/data_types/integer>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, name As `String</api/data_types/string>`, `ParamArray</api/language/paramarray>` values() As `String</api/data_types/string>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>

Returns a new instance of PDFBoxList from the parameters passed.

<div id="pdflistbox.constructor1">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Constructor

**Constructor**(pageNumber As `Integer</api/data_types/integer>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, name As `String</api/data_types/string>`, values() As `String</api/data_types/string>`)

> Returns a new instance of <span class="title-ref">PDFListBox</span> from the parameters passed.

<div id="pdflistbox.removeallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.RemoveAllRows

**RemoveAllRows**

> Removes all rows in the list.
>
> The following example removes all the existing rows prior to adding new rows using `AddAllRows<pdflistbox.addallrows>`.
>
> ``` xojo
> Var names() As String
> names.Add("Abbott")
> names.Add("Costello")
> names.Add("Frankenstein")
>
> ListBox1.RemoveAllRows
> ListBox1.AddAllRows(names)
> ```

<div id="pdflistbox.removerowat">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.RemoveRowAt

**RemoveRowAt**(index As `Integer</api/data_types/integer>`)

> Removes the specified row. The first row is numbered zero.
>
> The following example removes the third item (index position 2) from the listbox.
>
> ``` xojo
> ListBox1.RemoveRowAt(2)
> ```

<div id="pdflistbox.rows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFListBox.Rows

**Rows** As `String()</api/data_types/string>`

> Returns values of all rows.

## Notes

When creating a new control, the first item in the list will be selected by default.

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, Linux, macOS, Windows    |

<div class="seealso">

`PDFControl</api/pdf/pdfcontrol>` parent class; `PDFComboBox</api/pdf/pdfcombobox>` and `PDFPopupMenu</api/pdf/pdfpopupmenu>` classes.

</div>
