Class

# PDFPopupMenu

<div class="rst-class">

forsearch

</div>

PDF

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

## Description

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

## Methods

<div class="rst-class">

table-centered_column_4

</div>

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

## Property descriptions

<div id="pdfpopupmenu.fontsize">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.FontSize

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

> The size of the text of the control.

<div id="pdfpopupmenu.height">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.Height

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

> The height of the control.

<div id="pdfpopupmenu.issorted">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.IsSorted

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

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

<div id="pdfpopupmenu.lastaddedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

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

<div id="pdfpopupmenu.lastrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.LastRowIndex

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

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

<div id="pdfpopupmenu.name">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.Name

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

> The name of the control.

<div id="pdfpopupmenu.page">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.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="pdfpopupmenu.rowcount">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.RowCount

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

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

<div id="pdfpopupmenu.selectedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

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

<div id="pdfpopupmenu.selectedrowtext">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.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.UserPopup.SelectedRowText
> ```

<div id="pdfpopupmenu.width">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.Width

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

> The width of the control.

<div id="pdfpopupmenu.x">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.X

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

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

<div id="pdfpopupmenu.y">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.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="pdfpopupmenu.addallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.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<pdfpopupmenu.addrow>` that calls AddRow repeatedly.
>
> ``` xojo
> Me.AddAllRows("Banana", "Orange")
> ```

<div id="pdfpopupmenu.addrow">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.AddRow

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

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

<div id="pdfpopupmenu.addrowat">

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

</div>

<div class="rst-class">

forsearch

</div>

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

<div id="pdfpopupmenu.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

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

<div id="pdfpopupmenu.constructor1">

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

</div>

<div class="rst-class">

forsearch

</div>

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

<div id="pdfpopupmenu.removeallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.RemoveAllRows

**RemoveAllRows**

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

<div id="pdfpopupmenu.removerowat">

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

</div>

<div class="rst-class">

forsearch

</div>

PDFPopupMenu.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 popup menu.
>
> ``` xojo
> PopupMenu1.RemoveRowAt(2)
> ```

<div id="pdfpopupmenu.rowtextat">

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

</div>

<div class="rst-class">

forsearch

</div>

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

</div>
