Class

# PDFComboBox

<div class="rst-class">

forsearch

</div>

PDF

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

## Description

A standard combo 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<pdfcombobox.fontsize>`                   | `Integer</api/data_types/integer>` |           |        |
| `Height<pdfcombobox.height>`                       | `Integer</api/data_types/integer>` |           |        |
| `IsSorted<pdfcombobox.issorted>`                   | `Boolean</api/data_types/boolean>` |           |        |
| `LastAddedRowIndex<pdfcombobox.lastaddedrowindex>` | `Integer</api/data_types/integer>` | ✓         |        |
| `LastRowIndex<pdfcombobox.lastrowindex>`           | `Integer</api/data_types/integer>` | ✓         |        |
| `Name<pdfcombobox.name>`                           | `String</api/data_types/string>`   |           |        |
| `Page<pdfcombobox.page>`                           | `Integer</api/data_types/integer>` | ✓         |        |
| `RowCount<pdfcombobox.rowcount>`                   | `Integer</api/data_types/integer>` | ✓         |        |
| `SelectedRowIndex<pdfcombobox.selectedrowindex>`   | `Integer</api/data_types/integer>` |           |        |
| `SelectedRowText<pdfcombobox.selectedrowtext>`     | `String</api/data_types/string>`   | ✓         |        |
| `Width<pdfcombobox.width>`                         | `Integer</api/data_types/integer>` |           |        |
| `X<pdfcombobox.x>`                                 | `Integer</api/data_types/integer>` |           |        |
| `Y<pdfcombobox.y>`                                 | `Integer</api/data_types/integer>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                       | Parameters                                                                                                                                                                                                                                                                                                                                                   | Returns                          | Shared |
|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|--------|
| `AddAllRows<pdfcombobox.addallrows>`       | items() As `String</api/data_types/string>`                                                                                                                                                                                                                                                                                                                  |                                  |        |
| `AddRow<pdfcombobox.addrow>`               | item As `String</api/data_types/string>`                                                                                                                                                                                                                                                                                                                     |                                  |        |
| `AddRowAt<pdfcombobox.addrowat>`           | index As `Integer</api/data_types/integer>`, Item As `String</api/data_types/string>`                                                                                                                                                                                                                                                                        |                                  |        |
| `Constructor<pdfcombobox.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<pdfcombobox.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<pdfcombobox.removeallrows>` |                                                                                                                                                                                                                                                                                                                                                              |                                  |        |
| `RemoveRowAt<pdfcombobox.removerowat>`     | index As `Integer</api/data_types/integer>`                                                                                                                                                                                                                                                                                                                  |                                  |        |
| `RowTextAt<pdfcombobox.rowtextat>`         | row As `Integer</api/data_types/integer>`                                                                                                                                                                                                                                                                                                                    | `String</api/data_types/string>` |        |

## Property descriptions

<div id="pdfcombobox.fontsize">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.FontSize

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

> The size of the text of the control.

<div id="pdfcombobox.height">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.Height

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

> The height of the control.

<div id="pdfcombobox.issorted">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.IsSorted

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

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

<div id="pdfcombobox.lastaddedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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 combobox:
>
> ``` xojo
> Var r As Integer = ComboBox1.LastAddedRowIndex
> System.Beep
> MessageBox("The last value added was: " + ComboBox1.RowTextAt(r))
> ```

<div id="pdfcombobox.lastrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.LastRowIndex

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

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

<div id="pdfcombobox.name">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.Name

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

> The name of the control.

<div id="pdfcombobox.page">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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="pdfcombobox.rowcount">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.RowCount

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

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

<div id="pdfcombobox.selectedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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">PDFComboBox</span> control.
>
> The following example changes the selected item to the third item:
>
> ``` xojo
> FruitCombo.SelectedRowIndex = 2
> ```

<div id="pdfcombobox.selectedrowtext">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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.UserComboBox.SelectedRowText
> ```

<div id="pdfcombobox.width">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.Width

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

> The width of the control.

<div id="pdfcombobox.x">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.X

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

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

<div id="pdfcombobox.y">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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="pdfcombobox.addallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.AddAllRows

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

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

<div id="pdfcombobox.addrow">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.AddRow

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

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

<div id="pdfcombobox.addrowat">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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
> ComboBox1.AddRowAt(3,"Harry")
> ```

<div id="pdfcombobox.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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 <span class="title-ref">PDFComboBox</span> from the parameters passed.

<div id="pdfcombobox.constructor1">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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">PDFComboBox</span> from the parameters passed.

<div id="pdfcombobox.removeallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.RemoveAllRows

**RemoveAllRows**

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

<div id="pdfcombobox.removerowat">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.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 combobox.
>
> ``` xojo
> ComboBox1.RemoveRowAt(2)
> ```

<div id="pdfcombobox.rowtextat">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFComboBox.RowTextAt

**RowTextAt**(row As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Used to read the row text based on the index passed.

## 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; `PDFPopupMenu</api/pdf/pdfpopupmenu>` and `PDFListBox</api/pdf/pdflistbox>` classes.

</div>
