FormField
Overview
FormField is a class in Aspose.Words FOSS for .NET.
Inherits from: SpecialChar, IRunAttrSource.
Represents a single form field.
This class provides 12 methods for working with FormField objects in .NET programs.
Available methods include: Accept, Clone, GetAncestor, GetAncestorOf, GetText, NextPreOrder, NodeTypeToString, PreviousPreOrder, Remove, RemoveField, SetTextInputValue, ToString.
All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package.
Properties: CalculateOnExit, CheckBoxSize, Checked, CustomNodeId, Default, Document, and 30 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
NodeType | NodeType | Read | Returns FormField. |
Name | string | Read/Write | Gets or sets the form field name. |
Type | FieldType | Read | Returns the form field type. |
Result | string | Read/Write | Gets or sets a string that represents the result of this form field. |
StatusText | string | Read/Write | Returns or sets the text that’s displayed in the status bar when a form field has the focus. |
OwnStatus | bool | Read/Write | Specifies the source of the text that’s displayed in the status bar when a form field has the focus. |
HelpText | string | Read/Write | Returns or sets the text that’s displayed in a message box when the form field has the focus and the user presses F1. |
OwnHelp | bool | Read/Write | Specifies the source of the text that’s displayed in a message box when a form field has the focus and the user presses F1. |
CalculateOnExit | bool | Read/Write | True if references to the specified form field are automatically updated whenever the field is exited. |
EntryMacro | string | Read/Write | Returns or sets an entry macro name for the form field. |
ExitMacro | string | Read/Write | Returns or sets an exit macro name for the form field. |
Enabled | bool | Read/Write | True if a form field is enabled. |
TextInputFormat | string | Read/Write | Returns or sets the text formatting for a text form field. |
TextInputType | TextFormFieldType | Read/Write | Gets or sets the type of a text form field. |
TextInputDefault | string | Read/Write | Gets or sets the default string or a calculation expression of a text form field. |
MaxLength | int | Read/Write | Maximum length for the text field. |
DropDownItems | DropDownItemCollection | Read | Provides access to the items of a dropdown form field. |
DropDownSelectedIndex | int | Read/Write | Gets or sets the index specifying the currently selected item in a dropdown form field. |
Checked | bool | Read/Write | Gets or sets the checked status of the check box form field. |
Default | bool | Read/Write | Gets or sets the default value of the check box form field. |
IsCheckBoxExactSize | bool | Read/Write | Gets or sets the boolean value that indicates whether the size of the textbox is automatic or specified explicitly. |
CheckBoxSize | double | Read/Write | Gets or sets the size of the checkbox in points. |
ParentParagraph | Paragraph | Read | Retrieves the parent Paragraph of this node. |
Font | Font | Read | Provides access to the font formatting of this object. |
IsInsertRevision | bool | Read | Gets the is insert revision. |
IsDeleteRevision | bool | Read | Gets the is delete revision. |
IsMoveFromRevision | bool | Read | Gets the is move from revision. |
IsMoveToRevision | bool | Read | Gets the is move to revision. |
IsFormatRevision | bool | Read | Gets the is format revision. |
ParentNode | CompositeNode | Read | Gets the immediate parent of this node. |
Document | DocumentBase | Read | Gets the document to which this node belongs. |
PreviousSibling | Node | Read | Gets the node immediately preceding this node. |
NextSibling | Node | Read | Gets the node immediately following this node. |
IsComposite | bool | Read | Returns true if this node can contain other nodes. |
Range | Range | Read | Returns a Range object that represents the portion of a document that is contained in this node. |
CustomNodeId | int | Read/Write | Specifies custom node identifier. |
Methods
| Signature | Description |
|---|---|
Accept(visitor: DocumentVisitor) | Accepts a visitor. |
RemoveField() | Removes the complete form field, not just the form field special character. |
SetTextInputValue(newValue: object) | Applies the text format specified in TextInputFormat and stores the value in Result. |
GetText() | Gets the special character that this node represents. |
Clone(isCloneChildren: bool) | You should use the Clone(bool, INodeCloningListener) overload when the node cloning is a part of another (usually composite) node cloning process. |
GetAncestor(ancestorType: Type) | Gets the first ancestor of the specified object type. |
GetAncestorOf() | Provides access to the items of a dropdown form field. |
Remove() | Removes itself from the parent. |
NextPreOrder(rootNode: Node) | Gets next node according to the pre-order tree traversal algorithm. |
PreviousPreOrder(rootNode: Node) | Gets the previous node according to the pre-order tree traversal algorithm. |
ToString(saveFormat: SaveFormat) | Exports the content of the node into a string in the specified format. |
NodeTypeToString(nodeType: NodeType) | A utility method that converts a node type enum value into a user friendly string. |