menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class WTextFormField - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class WTextFormField

    Represents the text form field in the Word document.

    Inheritance
    System.Object
    OwnerHolder
    XDLSSerializableBase
    Entity
    WidgetBase
    ParagraphItem
    WTextRange
    WField
    WFormField
    WTextFormField
    Implements
    IXDLSSerializable
    IOfficeRun
    IWField
    IWTextRange
    IParagraphItem
    IEntity
    Inherited Members
    Entity.Clone()
    Entity.IsComposite
    Entity.NextSibling
    Entity.Owner
    Entity.PreviousSibling
    OwnerHolder.Document
    OwnerHolder.m_doc
    ParagraphItem.ApplyStyle(String)
    ParagraphItem.CloneRun()
    ParagraphItem.Dispose()
    ParagraphItem.IsDeleteRevision
    ParagraphItem.IsInsertRevision
    ParagraphItem.m_charFormat
    ParagraphItem.OwnerMathRunElement
    ParagraphItem.OwnerParagraph
    WField.ConvertSwitchesToString()
    WField.CreateLayoutInfo()
    WField.FieldCode
    WField.FieldPattern
    WField.FieldType
    WField.FieldValue
    WField.GetClonedTable(Entity, Boolean)
    WField.GetTextRange(String)
    WField.m_bConvertedToText
    WField.m_fieldType
    WField.m_fieldValue
    WField.m_formattingString
    WField.m_paraItemType
    WField.m_textFormat
    WField.ParseField(String)
    WField.ParseFieldCode(String)
    WField.ParseFieldFormat(String[])
    WField.RemoveMergeFormat(String)
    WField.RemovePreviousResult()
    WField.RemoveText(String, String)
    WField.ReplaceAllMergeFormatWithEmpty(String)
    WField.SplitIfArguments(String, List<Int32>, String)
    WField.TextFormat
    WField.Unlink()
    WField.Update()
    WField.UpdateCondition(String, List<Int32>, String)
    WField.UpdateFieldCode(String)
    WField.UpdateTextForParagraphItem(Entity, Boolean)
    WField.UpdateTextForTextBodyItem(Entity, Boolean)
    WFormField.CalculateOnExit
    WFormField.Enabled
    WFormField.FormFieldType
    WFormField.Help
    WFormField.m_curFormFieldType
    WFormField.MacroOnEnd
    WFormField.MacroOnStart
    WFormField.Name
    WFormField.StatusBarHelp
    WTextRange.ApplyCharacterFormat(WCharacterFormat)
    WTextRange.CharacterFormat
    WTextRange.ReadXmlContent(IXDLSContentReader)
    WTextRange.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.XDLSHolder
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class WTextFormField : WFormField, IXDLSSerializable, IOfficeRun, IStringWidget, ISplitLeafWidget, ITextMeasurable, IWField, IWTextRange, IParagraphItem, IEntity, ILeafWidget, IWidget
    Examples
    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create a new Word document 
        WordDocument document = new WordDocument();
        //Add new section to the document
        IWSection section = document.AddSection();
        //Add new paragraph to the section
        WParagraph paragraph = section.AddParagraph() as WParagraph;
        paragraph.AppendText("General Information");
        section.AddParagraph();
        paragraph = section.AddParagraph() as WParagraph;
        IWTextRange text = paragraph.AppendText("Name\t");
        text.CharacterFormat.Bold = true;
        //Append Text form field 
        WTextFormField textfield = paragraph.AppendTextFormField(null);
        //Set type of Text form field
        textfield.Type = TextFormFieldType.RegularText;
        textfield.CharacterFormat.FontName = "Calibri";
        textfield.CalculateOnExit = true;
        section.AddParagraph();
        paragraph = section.AddParagraph() as WParagraph;
        text = paragraph.AppendText("Date of Birth\t");
        text.CharacterFormat.Bold = true;
        //Append Text form field
        textfield = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"));
        textfield.StringFormat = "MM/DD/YY";
        //Set Text form field type
        textfield.Type = TextFormFieldType.DateText;
        textfield.CalculateOnExit = true;
        //Save the Word document
        document.Save("Textfield.docx", FormatType.Docx);
        //Close the document
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create a new Word document 
        Dim document As New WordDocument()
        'Add new section to the document
        Dim section As IWSection = document.AddSection()
        'Add new paragraph to the section
        Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
        paragraph.AppendText("General Information")
        section.AddParagraph()
        paragraph = TryCast(section.AddParagraph(), WParagraph)
        Dim text As IWTextRange = paragraph.AppendText("Name" & vbTab)
        text.CharacterFormat.Bold = True
        'Append Text form field 
        Dim textfield As WTextFormField = paragraph.AppendTextFormField(Nothing)
        'Set type of Text form field
        textfield.Type = TextFormFieldType.RegularText
        textfield.CharacterFormat.FontName = "Calibri"
        textfield.CalculateOnExit = True
        section.AddParagraph()
        paragraph = TryCast(section.AddParagraph(), WParagraph)
        text = paragraph.AppendText("Date of Birth" & vbTab)
        text.CharacterFormat.Bold = True
        'Append Text form field
        textfield = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"))
        textfield.StringFormat = "MM/DD/YY"
        'Set Text form field type
        textfield.Type = TextFormFieldType.DateText
        textfield.CalculateOnExit = True
        'Save the Word document
        document.Save("Textfield.docx", FormatType.Docx)
        'Close the document
        document.Close()
    End Sub

    Constructors

    WTextFormField(IWordDocument)

    Initializes a new instance of the WTextFormField class.

    Declaration
    public WTextFormField(IWordDocument doc)
    Parameters
    Type Name Description
    IWordDocument doc

    Properties

    DefaultText

    Gets or sets the default text for text form field.

    Declaration
    public string DefaultText { get; set; }
    Property Value
    Type Description
    System.String

    The string that specifies the default text.

    EntityType

    Gets the type of the entity. Read-only.

    Declaration
    public override EntityType EntityType { get; }
    Property Value
    Type Description
    EntityType

    The EntityType of the current item.

    Overrides
    WField.EntityType

    MaximumLength

    Gets or sets the maximum text length of the text form field.

    Declaration
    public int MaximumLength { get; set; }
    Property Value
    Type Description
    System.Int32

    The integer that specifies the maximum length of the text.

    StringFormat

    Gets or sets the string text format (text, date/time, number) directly.

    Declaration
    public string StringFormat { get; set; }
    Property Value
    Type Description
    System.String

    The string that specifies the text format.

    Text

    Gets or sets the text of text form field.

    Declaration
    public override string Text { get; set; }
    Property Value
    Type Description
    System.String

    The string that specifies the text.

    Overrides
    WField.Text

    TextRange

    Gets or sets the form field text range.

    Declaration
    public WTextRange TextRange { get; set; }
    Property Value
    Type Description
    WTextRange

    The WTextRange instance that specifies the form field text.

    Type

    Gets or sets text form field type.

    Declaration
    public TextFormFieldType Type { get; set; }
    Property Value
    Type Description
    TextFormFieldType

    The TextFormFieldType member that specifies the type of text form field.

    Methods

    CloneImpl()

    Creates a duplicate copy of the entity.

    Declaration
    protected override object CloneImpl()
    Returns
    Type Description
    System.Object

    The reference to the newly created object.

    Overrides
    WFormField.CloneImpl()

    InitXDLSHolder()

    Registers child objects in XDSL holder.

    Declaration
    protected override void InitXDLSHolder()
    Overrides
    WTextRange.InitXDLSHolder()

    ReadXmlAttributes(IXDLSAttributeReader)

    Reads object data from xml attributes.

    Declaration
    protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
    Parameters
    Type Name Description
    IXDLSAttributeReader reader

    The IXDLSAttributeReader object.

    Overrides
    WFormField.ReadXmlAttributes(IXDLSAttributeReader)

    WriteXmlAttributes(IXDLSAttributeWriter)

    Writes object data as xml attributes.

    Declaration
    protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
    Parameters
    Type Name Description
    IXDLSAttributeWriter writer

    The IXDLSAttributeWriter object.

    Overrides
    WFormField.WriteXmlAttributes(IXDLSAttributeWriter)

    Implements

    IXDLSSerializable
    IOfficeRun
    IWField
    IWTextRange
    IParagraphItem
    IEntity
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved