Table of Contents

Class ListBoxField

Namespace
iText.Forms.Form.Element
Assembly
itext.forms.dll

A field that represents a control for selecting one or several of the provided options.

public class ListBoxField : AbstractSelectField, IFormField, IBlockElement, IAbstractElement, IElement, IPropertyContainer, IAccessibleElement
Inheritance
ListBoxField
Implements
Inherited Members

Constructors

ListBoxField(string, int, bool)

Create a new list box field.

public ListBoxField(string id, int size, bool allowMultipleSelection)

Parameters

id string

the id

size int

the size of the list box, which will define the height of visible properties, shall be greater than zero

allowMultipleSelection bool

a boolean flag that defines whether multiple options are allowed to be selected at once

Methods

AddOption(string)

Add an option for ListBoxField.

public virtual ListBoxField AddOption(string option)

Parameters

option string

string representation of the option.

Returns

ListBoxField

this ListBoxField.

Remarks

Add an option for ListBoxField . The option is not selected.

AddOption(string, bool)

Add an option for ListBoxField.

public virtual ListBoxField AddOption(string option, bool selected)

Parameters

option string

string representation of the option.

selected bool

true is the option if selected, false otherwise.

Returns

ListBoxField

this ListBoxField.

GetAccessibilityProperties()

public override AccessibilityProperties GetAccessibilityProperties()

Returns

AccessibilityProperties

GetDefaultProperty<T1>(int)

public override T1 GetDefaultProperty<T1>(int property)

Parameters

property int

Returns

T1

Type Parameters

T1

GetSelectedStrings()

Get a list of selected options.

public virtual IList<string> GetSelectedStrings()

Returns

IList<string>

a list of display values of selected options.

MakeNewRenderer()

protected override IRenderer MakeNewRenderer()

Returns

IRenderer