Class
PDFComboBox
Description
A standard combo box that can be embedded into a PDFDocument.
Properties
Name |
Type |
Read-Only |
Shared |
---|---|---|---|
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
items() As String |
|||
item As String |
|||
item As DesktopMenuItem |
|||
pageNumber As Integer, x As Integer, y As Integer, width As Integer, height As Integer, name As String, ParamArray values() As String |
|||
pageNumber As Integer, x As Integer, y As Integer, width As Integer, height As Integer, name As String, values() As String |
|||
index As Integer |
|||
index As Integer |
|||
row As Integer |
Property descriptions
PDFComboBox.FontSize
FontSize As Integer
The size of the text of the control.
PDFComboBox.Height
Height As Integer
The height of the control.
PDFComboBox.IsSorted
IsSorted As Boolean
When set to True, the data is sorted in ascending order.
PDFComboBox.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 combobox:
Var r As Integer = ComboBox1.LastAddedRowIndex
System.Beep
MessageBox("The last value added was: " + ComboBox1.RowTextAt(r))
PDFComboBox.LastRowIndex
LastRowIndex As Integer
The number of the last row of the PDFComboBox.
This property is read-only.
This value will be 1 less than the PDFComboBox.
PDFComboBox.Name
Name As String
The name of the control.
PDFComboBox.Page
Page As Integer
The number of the page upon which the control was created.
This property is read-only.
PDFComboBox.RowCount
RowCount As Integer
The number of rows in the combobox.
This property is read-only.
This example displays the number of rows in the combobox.
MessageBox(FruitCombo.RowCount.ToString)
PDFComboBox.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 PDFComboBox control.
The following example changes the selected item to the third item:
FruitCombo.SelectedRowIndex = 2
PDFComboBox.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.UserComboBox.SelectedRowText
PDFComboBox.Width
Width As Integer
The width of the control.
PDFComboBox.X
X As Integer
The location on the X axis of the upper-left corner of the control.
PDFComboBox.Y
Y As Integer
The location on the Y axis of the upper-left corner of the control.
Method descriptions
PDFComboBox.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.
ComboBox1.AddAllRows("Banana", "Orange")
PDFComboBox.AddRow
AddRow(item As String)
Appends Item in a new row to the end of the list.
PDFComboBox.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.
ComboBox1.AddRow("Banana")
ComboBox1.AddRow("Orange")
PDFComboBox.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.
ComboBox1.AddRowAt(3,"Harry")
PDFComboBox.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 PDFComboBox from the parameters passed.
PDFComboBox.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 PDFComboBox from the parameters passed.
PDFComboBox.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")
ComboBox1.RemoveAllRows
ComboBox1.AddAllRows(names)
PDFComboBox.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 combobox.
ComboBox1.RemoveRowAt(2)
PDFComboBox.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 = ComboBox1.RowCount - 1
For i As Integer = 0 To nItems
ComboBox1.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 = ComboBox1.RowTagAt(1)
PDFComboBox.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; PDFPopupMenu and PDFListBox classes.