Class

# MobilePopupMenu

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

## Description

Displays a list of items when clicked. The user can select one item from the list.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                     | Type                                                          | Read-Only | Shared |
|----------------------------------------------------------|---------------------------------------------------------------|-----------|--------|
| `AccessibilityHint<mobilepopupmenu.accessibilityhint>`   | `String</api/data_types/string>`                              |           |        |
| `AccessibilityLabel<mobilepopupmenu.accessibilitylabel>` | `String</api/data_types/string>`                              |           |        |
| `ControlCount<mobilepopupmenu.controlcount>`             | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Enabled<mobilepopupmenu.enabled>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `Height<mobilepopupmenu.height>`                         | `Integer</api/data_types/integer>`                            |           |        |
| `InitialValue<mobilepopupmenu.initialvalue>`             | `String</api/data_types/string>`                              | ✓         |        |
| `LastAddedRowIndex<mobilepopupmenu.lastaddedrowindex>`   | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LastRowIndex<mobilepopupmenu.lastrowindex>`             | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Left<mobilepopupmenu.left>`                             | `Integer</api/data_types/integer>`                            |           |        |
| `LockBottom<mobilepopupmenu.lockbottom>`                 | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockLeft<mobilepopupmenu.lockleft>`                     | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockRight<mobilepopupmenu.lockright>`                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockTop<mobilepopupmenu.locktop>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `Name<mobilepopupmenu.name>`                             | `String</api/data_types/string>`                              | ✓         |        |
| `Parent<mobilepopupmenu.parent>`                         | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` | ✓         |        |
| `RowCount<mobilepopupmenu.rowcount>`                     | `Integer</api/data_types/integer>`                            | ✓         |        |
| `SelectedRowIndex<mobilepopupmenu.selectedrowindex>`     | `Integer</api/data_types/integer>`                            |           |        |
| `SelectedRowText<mobilepopupmenu.selectedrowtext>`       | `String</api/data_types/string>`                              | ✓\`       |        |
| `Top<mobilepopupmenu.top>`                               | `Integer</api/data_types/integer>`                            |           |        |
| `Visible<mobilepopupmenu.visible>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `Width<mobilepopupmenu.width>`                           | `Integer</api/data_types/integer>`                            |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                   | Parameters                                                                                | Returns                                     | Shared |
|--------------------------------------------------------|-------------------------------------------------------------------------------------------|---------------------------------------------|--------|
| `AddAllRows<mobilepopupmenu.addallrows>`               | items() As `String</api/data_types/string>`                                               |                                             |        |
|                                                        | `ParamArray</api/language/paramarray>` items As `String</api/data_types/string>`          |                                             |        |
| `AddRow<mobilepopupmenu.addrow>`                       | item As `String</api/data_types/string>`                                                  |                                             |        |
| `AddRowAt<mobilepopupmenu.addrowat>`                   | rowNumber As `Integer</api/data_types/integer>`, item As `String</api/data_types/string>` |                                             |        |
| `ClearFocus<mobilepopupmenu.clearfocus>`               |                                                                                           |                                             |        |
| `Handle<mobilepopupmenu.handle>`                       |                                                                                           | `Ptr</api/data_types/additional_types/ptr>` |        |
| `Refresh<mobilepopupmenu.refresh>`                     |                                                                                           |                                             |        |
| `RemoveAllRows<mobilepopupmenu.removeallrows>`         |                                                                                           |                                             |        |
| `RemoveRowAt<mobilepopupmenu.removerowat>`             | index As `Integer</api/data_types/integer>`                                               |                                             |        |
| `RowTagAt<mobilepopupmenu.rowtagat>`                   | index As `Integer</api/data_types/integer>`                                               | `Variant</api/data_types/variant>`          |        |
| `RowTextAt<mobilepopupmenu.rowtextat>`                 | index As `Integer</api/data_types/integer>`                                               | `String</api/data_types/string>`            |        |
| `SelectRowWithTag<mobilepopupmenu.selectrowwithtag>`   | value As `Variant</api/data_types/variant>`                                               |                                             |        |
| `SelectRowWithText<mobilepopupmenu.selectrowwithtext>` | value As `String</api/data_types/string>`                                                 |                                             |        |
| `SetFocus<mobilepopupmenu.setfocus>`                   |                                                                                           |                                             |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                 | Parameters | Returns |
|------------------------------------------------------|------------|---------|
| `Closing<mobilepopupmenu.closing>`                   |            |         |
| `Opening<mobilepopupmenu.opening>`                   |            |         |
| `SelectionChanged<mobilepopupmenu.selectionchanged>` |            |         |

## Property descriptions

<div id="mobilepopupmenu.accessibilityhint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.AccessibilityHint

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

> The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.
>
> ``` xojo
> Me.AccessibilityHint = "Click to calculate the value and display the next screen."
> ```

<div id="mobilepopupmenu.accessibilitylabel">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.AccessibilityLabel

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

> The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.
>
> ``` xojo
> Me.AccessibilityLabel = "Calculate the value."
> ```

<div id="mobilepopupmenu.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.ControlCount

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

> The number of child controls in the control.
>
> This property is read-only.

<div id="mobilepopupmenu.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Enabled

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

> Indicates whether the control is enabled or disabled.
>
> Disable the popupmenu:
>
> ``` xojo
> PopupMenu1.Enabled = False
> ```

<div id="mobilepopupmenu.height">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Height

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

> The height of the control.

<div id="mobilepopupmenu.initialvalue">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.InitialValue

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

> A list of the default items separated by returns.
>
> This property is read-only.
>
> This property is unreadable at runtime because the list is removed from memory once the control is created. You can set a default value for the control by populating the pop-up with *InitialValue* and setting the default value with *SelectedRowIndex*.

<div id="mobilepopupmenu.lastaddedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.LastAddedRowIndex

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

> The number of the last row added with the AddRow or AddRowAt method.
>
> This property is read-only.
>
> If no rows have been added, LastAddedRowIndex will be -1.

<div id="mobilepopupmenu.lastrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.LastRowIndex

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

> The index of the last row of the <span class="title-ref">MobilePopupMenu</span>.
>
> This property is read-only.

<div id="mobilepopupmenu.left">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Left

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

> The left position of the control.

<div id="mobilepopupmenu.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.LockBottom

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

> Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning screen.
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockBottom = True
> ```

<div id="mobilepopupmenu.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.LockLeft

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

> Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning screen.
>
> LockLeft and Locktop default to `True</api/language/true>` when you add a new control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. *LockLeft* has no effect unless *LockRight* is `True</api/language/true>`.
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockLeft = True
> ```

<div id="mobilepopupmenu.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.LockRight

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

> Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning screen.
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockRight = True
> ```

<div id="mobilepopupmenu.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.LockTop

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

> Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning screen.
>
> LockTop and LockLeft default to `True</api/language/true>` when you add a control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. *LockTop* has no effect unless *LockBottom* is `True</api/language/true>`.
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockTop = True
> ```

<div id="mobilepopupmenu.name">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Name

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

> The name of the control.
>
> This property is read-only.

<div id="mobilepopupmenu.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Parent

**Parent** As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`

> The parent (sometimes called a "Super") class of the control.
>
> This property is read-only.

<div id="mobilepopupmenu.rowcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.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="mobilepopupmenu.selectedrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.SelectedRowIndex

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

> Used to get or set the selected item number. The first item is zero.
>
> SelectedRowIndex may be set using the Properties pane to set the default value of PopupMenu control. If you use the InitialValue property to populate the PopupMenu control and set a value of SelectedRowIndex that corresponds to a default item, that item will be displayed in the IDE.
>
> <span class="title-ref">MobilePopupMenu</span> requires a selection, so setting SelectedRowIndex to -1 does not clear the selection. If you need a way to indicate nothing has been selected, consider adding a row that says “No Selection” and check for that.
>
> The following example changes the selected item to the third item:
>
> ``` xojo
> FruitMenu.SelectedRowIndex = 2
> ```

<div id="mobilepopupmenu.selectedrowtext">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.SelectedRowText

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

> The text of the currently selected row.
>
> This property is read-only.
>
> This example displays the text of the currently selected item in a `MobileTextField</api/user_interface/mobile/mobiletextfield>`.
>
> ``` xojo
> TextField1.Text = PopupMenu1.SelectedRowText
> ```

<div id="mobilepopupmenu.top">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Top

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

> The top position of the control.

<div id="mobilepopupmenu.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Visible

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

> Indicates whether the control is visible.
>
> Make the control invisible:
>
> ``` xojo
> PopupMenu1.Visible = False
> ```

<div id="mobilepopupmenu.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Width

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

> The width of the control.

## Method descriptions

<div id="mobilepopupmenu.addallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

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

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

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

> Adds all *items* passed to the pop-up menu.

<div id="mobilepopupmenu.addrow">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.AddRow

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

> Appends *item* in a new row to the end of the list.
>
> The following example in the Opening event of the control adds two rows to the menu.
>
> ``` xojo
> Me.AddRow("Banana")
> Me.AddRow("Orange")
> ```

<div id="mobilepopupmenu.addrowat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.AddRowAt

**AddRowAt**(rowNumber 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="mobilepopupmenu.clearfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.ClearFocus

**ClearFocus**

> Removes the focus from the control.
>
> ``` xojo
> PopupMenu1.ClearFocus
> ```

<div id="mobilepopupmenu.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> The handle to the underlying native OS control.

<div id="mobilepopupmenu.refresh">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Refresh

**Refresh**

> Marks the control so that it will be redrawn during the next event loop.
>
> Call Refresh to force a PopupMenu to redraw itself:
>
> ``` xojo
> PopupMenu1.Refresh
> ```

<div id="mobilepopupmenu.removeallrows">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.RemoveAllRows

**RemoveAllRows**

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

<div id="mobilepopupmenu.removerowat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.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
> Me.RemoveRowAt(2)
> ```

<div id="mobilepopupmenu.rowtagat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.RowTagAt

**RowTagAt**(index As `Integer</api/data_types/integer>`) As `Variant</api/data_types/variant>`

> A "hidden" identifier associated with the item identified by the *index* parameter.
>
> If you want to compare the value of row tag to another value, you should first convert the `Variant</api/data_types/variant>` to it actual data type.
>
> This example populates the RowTagAt identifier with a sequence number.
>
> ``` xojo
> Var nItems As Integer
> nItems = Me.RowCount - 1
> For i As Integer = 0 To nItems
> Me.RowTagAt(i) = i
> Next
> ```
>
> Since a row tag is a `Variant</api/data_types/variant>`, you must first convert it to an `Integer</api/data_types/integer>` if you want to compare it to another Integer. Do this with an assignment statement such as:
>
> ``` xojo
> Var recID As Integer
> recID = PopupMenu1.RowTagAt(1) ' ComboBox inherits from PopupMenu so it also inherits the RowTagAt method
> ```
>
> You can also use the `CType</api/language/ctype>` function to do an explicit conversion to any other datatype. Then compare recID to another `Integer</api/data_types/integer>`: Displaying the row tag of the selected menu item:
>
> ``` xojo
> TextField1.Text = PopupMenu1.RowTagAt(PopupMenu1.SelectedRowIndex)
> ```

<div id="mobilepopupmenu.rowtextat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.RowTextAt

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

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

<div id="mobilepopupmenu.selectrowwithtag">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.SelectRowWithTag

**SelectRowWithTag**(value As `Variant</api/data_types/variant>`)

> Selects the first row whose tag matches the *value* passed.
>
> If *value* is not found, an `InvalidArgumentException</api/exceptions/invalidargumentexception>` is raised.

<div id="mobilepopupmenu.selectrowwithtext">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.SelectRowWithText

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

> Selects the first row whose value matches the provided *value*.
>
> If *value* is not found, an `InvalidArgumentException</api/exceptions/invalidargumentexception>` is raised.

<div id="mobilepopupmenu.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.SetFocus

**SetFocus**

> Sets the focus to the control.
>
> ``` xojo
> PopupMenu1.SetFocus
> ```

## Event descriptions

<div id="mobilepopupmenu.closing">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Closing

**Closing**

> The control is closing.

<div id="mobilepopupmenu.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.Opening

**Opening**

> The control is about to be displayed. Use this event to initialize a control.
>
> The Opening event is called after the Constructor.
>
> Be warned that initializing control property values using the Constructor instead of the Opening event may result in those property values being overwritten by what is set in the Inspector. For best results, use the Opening event for control initialization rather than the control Constructor.

<div id="mobilepopupmenu.selectionchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

MobilePopupMenu.SelectionChanged

**SelectionChanged**

> The selected item has changed.
>
> The *item* parameter is the newly selected item from the PopupMenu. Alternatively, use the `SelectedRowIndex<mobilepopupmenu.selectedrowindex>` property to get the index of the newly selected value.
>
> The item is a copy of the menu item from the control therefore changing the item itself will have no impact on the original.

## Sample code

This code in the Opening event handler populates a popup menu and sets the initial value to the current month:

``` xojo
Var months() As String = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
For Each m As String In months
  Me.AddRow(m)
Next

Var d As DateTime = DateTime.Now
Me.SelectedRowIndex = d.Month - 1 ' Select current month
```

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

Examine the value of SelectedRowIndex in the SelectionChanged event handler to determine which item was selected.

This code adds an item to PopupMenu:

``` xojo
PopupMenu1.AddRow("October")
```

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

This code populates the RowTag identifier with a sequence number:

``` xojo
For i As Integer = 0 To Me.LastRowIndex
  Me.RowTag(i) = i
Next
```

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

Since RowTagAt is a `Variant</api/data_types/variant>`, you must first convert it to an `Integer</api/data_types/integer>` if you want to compare it to another integer. Do this with a simple assignment statement such as:

``` xojo
Var recID As Integer
recID = PopupMenu1.RowTagAt(1)
```

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

Then compare recID to another `Integer</api/data_types/integer>`.

This code opens a screen called ListEditor when the "Edit List..." item is chosen.

``` xojo
Sub SelectionChanged()
If PopupMenu1.SelectedRowText = "Edit List..." Then
  ListEditor.Show
End If
```

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

Changing the selected item in a PopupMenu:

``` xojo
PopupMenu1.SelectedRowIndex = 3 ' Selects the 4th row in the list (0-based)
```

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

Displaying the RowTag of the selected menu item:

``` xojo
TexField1.Text = PopupMenu1.RowTag(PopupMenu1.SelectedRowIndex)
```

## Compatibility

|                       |         |
|-----------------------|---------|
| **Project Types**     | Mobile  |
| **Operating Systems** | Android |

<div class="seealso">

`MobileUIControl</api/user_interface/mobile/mobileuicontrol>` parent class

</div>
