New to Telerik Document Processing? Start a free 30-day trial
TextBoxField Class
Updated on May 11, 2026
This article describes the following topics:
Overview
This class corresponds to FormFieldType.TextBox enum value and represents a TextBox data container.
Properties
TextBoxField exposes the following properties:
| Property | Description |
|---|---|
Value | Gets or sets the current text value of the field. |
DefaultValue | Gets or sets the default value used when the AcroForm is reset to its default values. |
Widgets | The collection of Widget annotations representing the field on the PDF pages. Widgets can be added using AddWidget() and removed using Remove(). Implements IEnumerable. |
IsMultiline | Indicates whether the text box should support multiline text input. |
IsPassword | Indicates whether the text input is a password field. When true, the viewer hides the inputted characters. |
IsFileSelect | Indicates whether the field represents the path name of a file whose contents are to be submitted as the value of the field. |
ShouldSpellCheck | Indicates whether the text should be spell checked during input. |
AllowScroll | Indicates whether scrolling is allowed for larger text content. When false, the maximum text input is restricted to the Widget annotation rectangle. |
MaxLengthOfInputCharacters | Specifies the maximum length of the inputted text. When null, the text length is unrestricted. |
Example 1: Create a TextBoxField and add it to a page
C#
RadFixedDocument fixedDocument = new RadFixedDocument();
fixedDocument.Pages.AddPage();
TextBoxField textField = new TextBoxField("SampleTextBox")
{
MaxLengthOfInputCharacters = 500,
IsMultiline = true,
IsPassword = false,
IsFileSelect = false,
ShouldSpellCheck = true,
AllowScroll = true,
Value = "Sample content",
};
VariableContentWidget widget = textField.Widgets.AddWidget();
widget.Rect = new Rect(0, 0, 250, 50);
widget.RecalculateContent();
fixedDocument.AcroForm.FormFields.Add(textField);
fixedDocument.Pages[0].Annotations.Add(widget);
In .NET Standard use Telerik.Documents.Primitives.Rect instead of System.Windows.Rect.