Class

PDFPopupMenu


Description

A standard popup menu that can be embedded into a PDFDocument.

Methods

Name

Parameters

Returns

Shared

AddAllRows

items() As String

AddRow

item As String

item As DesktopMenuItem

AddRowAt

index As Integer, Item As String

Constructor

pageNumber As Integer, x As Integer, y As Integer, width As Integer, height As Integer, name As String, ParamArray values() As String

Constructor

pageNumber As Integer, x As Integer, y As Integer, width As Integer, height As Integer, name As String, values() As String

RemoveAllRows

RemoveRowAt

index As Integer

RowTagAt

index As Integer

Variant

RowTextAt

row As Integer

String

Property descriptions


PDFPopupMenu.FontSize

FontSize As Integer

The size of the text of the control.


PDFPopupMenu.Height

Height As Integer

The height of the control.


PDFPopupMenu.IsSorted

IsSorted As Boolean

When set to True, the data is sorted in ascending order.


PDFPopupMenu.LastAddedRowIndex

LastAddedRowIndex As 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:

Var r As Integer = PopupMenu1.LastAddedRowIndex
System.Beep
MessageBox("The last value added was: " + PopupMenu1.RowTextAt(r))

PDFPopupMenu.LastRowIndex

LastRowIndex As Integer

The number of the last row of the PDFPopupMenu.

This property is read-only.

This value will be 1 less than the PDFPopupMenu.


PDFPopupMenu.Name

Name As String

The name of the control.


PDFPopupMenu.Page

Page As Integer

The number of the page upon which the control was created.

This property is read-only.


PDFPopupMenu.RowCount

RowCount As 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.

MessageBox(FruitPopup.RowCount.ToString)

PDFPopupMenu.SelectedRowIndex

SelectedRowIndex As 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 PDFPopupMenu control.

The following example changes the selected item to the third item:

FruitMenu.SelectedRowIndex = 2

PDFPopupMenu.SelectedRowText

SelectedRowText As 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.

UserName.Text = PDFdoc.UserPopup.SelectedRowText

PDFPopupMenu.Width

Width As Integer

The width of the control.


PDFPopupMenu.X

X As Integer

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


PDFPopupMenu.Y

Y As Integer

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

Method descriptions


PDFPopupMenu.AddAllRows

AddAllRows(items() As 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 that calls AddRow repeatedly.

Me.AddAllRows("Banana", "Orange")

PDFPopupMenu.AddRow

AddRow(item As String)

Appends Item in a new row to the end of the list.


PDFPopupMenu.AddRow

AddRow(item As DesktopMenuItem)

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.

Me.AddRow("Banana")
Me.AddRow("Orange")

PDFPopupMenu.AddRowAt

AddRowAt(index As Integer, Item As 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.

PopupMenu1.AddRowAt(3,"Harry")

PDFPopupMenu.Constructor

Constructor(pageNumber As Integer, x As Integer, y As Integer, width As Integer, height As Integer, name As String, ParamArray values() As String)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Returns a new instance of PDFPopupMenu from the parameters passed.


PDFPopupMenu.Constructor

Constructor(pageNumber As Integer, x As Integer, y As Integer, width As Integer, height As Integer, name As String, values() As String)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Returns a new instance of PDFPopupMenu from the parameters passed.


PDFPopupMenu.RemoveAllRows

RemoveAllRows

Removes all rows in the list.

The following example removes all the existing rows prior to adding new rows using AddAllRows.

Var names() As String
names.Add("Abbott")
names.Add("Costello")
names.Add("Frankenstein")

PopupMenu1.RemoveAllRows
PopupMenu1.AddAllRows(names)

PDFPopupMenu.RemoveRowAt

RemoveRowAt(index As 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.

PopupMenu1.RemoveRowAt(2)

PDFPopupMenu.RowTagAt

RowTagAt(index As Integer) As Variant

A "hidden" identifier associated with the item identified by the row parameter.

If you want to compare the value of row tag to another value, you should first convert the Variant to it actual data type.

This example populates the RowTagAt identifier with a sequence number.

Var nItems As Integer
nItems = PopupMenu1.RowCount - 1
For i As Integer = 0 To nItems
  PopupMenu1.RowTagAt(i) = i
Next

Since a row tag is a Variant, you must first convert it to an Integer if you want to compare it to another Integer. Do this with an assignment statement such as:

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

PDFPopupMenu.RowTextAt

RowTextAt(row As Integer) As 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

Desktop, console, web and iOS project types on all supported operating systems.

See also

PDFControl parent class; PDFComboBox and PDFListBox classes.