Table of Contents

Class Button

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

Extension of the FormField<T> class representing a button in html.

public class Button : FormField<Button>, IFormField, IBlockElement, IAbstractElement, IElement, IPropertyContainer, IAccessibleElement
Inheritance
Button
Implements
Inherited Members

Constructors

Button(string)

Creates a new Button instance.

public Button(string id)

Parameters

id string

the id

Methods

Add(IBlockElement)

Adds any block element to the div's contents.

public virtual Button Add(IBlockElement element)

Parameters

element IBlockElement

a BlockElement<T>

Returns

Button

this Element

Add(Image)

Adds an image to the div's contents.

public virtual Button Add(Image element)

Parameters

element Image

an Image

Returns

Button

this Element

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

IsSingleLine()

Indicates if this element represents an input with type button in html.

public virtual bool IsSingleLine()

Returns

bool

true if it's the button with only one line caption.

MakeNewRenderer()

protected override IRenderer MakeNewRenderer()

Returns

IRenderer

SetSingleLineValue(string)

Sets passed string value to the single line button caption.

public virtual Button SetSingleLineValue(string value)

Parameters

value string

string value to be set as caption.

Returns

Button

this same Button instance.

Remarks

Sets passed string value to the single line button caption. Value will be clipped if it is not fit into single line. For multiple line value use SetValue(string) . Note that when adding other elements to the button after this method is called, this added value can be multiline.

SetValue(string)

Adds passed string value as paragraph to the button.

public override IFormField SetValue(string value)

Parameters

value string

string value to be added into button.

Returns

IFormField

Remarks

Adds passed string value as paragraph to the button. Value can be multiline if it is not fit into single line. For single line value use SetSingleLineValue(string) . Note that the new value will replace all already added elements.