WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfXfaComboBoxField

    Show / Hide Table of Contents

    Class PdfXfaComboBoxField

    Represents the combo box field of the XFA form.

    Inheritance
    System.Object
    PdfXfaField
    PdfXfaStyledField
    PdfXfaComboBoxField
    Inherited Members
    PdfXfaStyledField.Width
    PdfXfaStyledField.Height
    PdfXfaStyledField.Border
    PdfXfaStyledField.ToolTip
    PdfXfaStyledField.ReadOnly
    PdfXfaStyledField.Font
    PdfXfaStyledField.ForeColor
    PdfXfaStyledField.HorizontalAlignment
    PdfXfaStyledField.VerticalAlignment
    PdfXfaStyledField.Rotate
    PdfXfaField.Name
    PdfXfaField.Margins
    PdfXfaField.Visibility
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Xfa
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfXfaComboBoxField : PdfXfaStyledField
    Examples
    //Create a new XFA document 
    PdfXfaDocument document = new PdfXfaDocument();
    //Create a new XFA form
    PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
    //Create a new XFA combo box field
    PdfXfaComboBoxField field = new PdfXfaComboBoxField("combo1", new SizeF(100, 30));
    //Add items.          
    field.Items.Add("One");
    field.Items.Add("Two");
    field.Items.Add("Three");
    field.Items.Add("Four");
    field.Items.Add("Five");
    //Add the field to the form
    form.Fields.Add(field);            
    document.XfaForm = form;
    //Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic);
    //Close the document
    document.Close();
    'Create a new XFA document 
    Dim document As New PdfXfaDocument()
    'Create a new XFA form
    Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
    'Create a new XFA combo box field
    Dim field As New PdfXfaComboBoxField("combo1", New SizeF(100, 30))
    'Add items.          
    field.Items.Add("One")
    field.Items.Add("Two")
    field.Items.Add("Three")
    field.Items.Add("Four")
    field.Items.Add("Five")
    'Add the field to the form
    form.Fields.Add(field)
    document.XfaForm = form
    'Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic)
    'Close the document
    document.Close()

    Constructors

    PdfXfaComboBoxField(String, SizeF)

    Initialize a new instance of the PdfXfaComboBoxField class.

    Declaration
    public PdfXfaComboBoxField(string name, SizeF size)
    Parameters
    Type Name Description
    System.String name

    The name of the field.

    System.Drawing.SizeF size

    The size of the field.

    Examples
    //Create a new XFA document 
    PdfXfaDocument document = new PdfXfaDocument();
    //Create a new XFA form
    PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
    //Create a new XFA combo box field
    PdfXfaComboBoxField field = new PdfXfaComboBoxField("combo1", new SizeF(100, 30));
    //Add items.          
    field.Items.Add("One");
    field.Items.Add("Two");
    field.Items.Add("Three");
    field.Items.Add("Four");
    field.Items.Add("Five");
    //Add the field to the form
    form.Fields.Add(field);            
    document.XfaForm = form;
    //Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic);
    //Close the document
    document.Close();
    'Create a new XFA document 
    Dim document As New PdfXfaDocument()
    'Create a new XFA form
    Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
    'Create a new XFA combo box field
    Dim field As New PdfXfaComboBoxField("combo1", New SizeF(100, 30))
    'Add items.          
    field.Items.Add("One")
    field.Items.Add("Two")
    field.Items.Add("Three")
    field.Items.Add("Four")
    field.Items.Add("Five")
    'Add the field to the form
    form.Fields.Add(field)
    document.XfaForm = form
    'Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic)
    'Close the document
    document.Close()

    PdfXfaComboBoxField(String, SizeF, List<String>)

    Declaration
    public PdfXfaComboBoxField(string name, SizeF size, List<string> items)
    Parameters
    Type Name Description
    System.String name
    System.Drawing.SizeF size
    System.Collections.Generic.List<System.String> items

    PdfXfaComboBoxField(String, Single, Single)

    Initialize a new instance of the PdfXfaComboBoxField class.

    Declaration
    public PdfXfaComboBoxField(string name, float width, float height)
    Parameters
    Type Name Description
    System.String name

    The name of the field.

    System.Single width

    Width of the field.

    System.Single height

    Height of the field.

    Examples
    //Create a new XFA document 
    PdfXfaDocument document = new PdfXfaDocument();
    //Create a new XFA form
    PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
    //Create a new XFA combo box field
    PdfXfaComboBoxField field = new PdfXfaComboBoxField("combo1", 100, 30);
    //Add items.          
    field.Items.Add("One");
    field.Items.Add("Two");
    field.Items.Add("Three");
    field.Items.Add("Four");
    field.Items.Add("Five");
    //Add the field to the form
    form.Fields.Add(field);            
    document.XfaForm = form;
    //Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic);
    //Close the document
    document.Close();
    'Create a new XFA document 
    Dim document As New PdfXfaDocument()
    'Create a new XFA form
    Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
    'Create a new XFA combo box field
    Dim field As New PdfXfaComboBoxField("combo1", 100, 30)
    'Add items.          
    field.Items.Add("One")
    field.Items.Add("Two")
    field.Items.Add("Three")
    field.Items.Add("Four")
    field.Items.Add("Five")
    'Add the field to the form
    form.Fields.Add(field)
    document.XfaForm = form
    'Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic)
    'Close the document
    document.Close()

    PdfXfaComboBoxField(String, Single, Single, List<String>)

    Declaration
    public PdfXfaComboBoxField(string name, float width, float height, List<string> items)
    Parameters
    Type Name Description
    System.String name
    System.Single width
    System.Single height
    System.Collections.Generic.List<System.String> items

    Properties

    AllowTextEntry

    Declaration
    public bool AllowTextEntry { get; set; }
    Property Value
    Type Description
    System.Boolean

    Caption

    Declaration
    public PdfXfaCaption Caption { get; set; }
    Property Value
    Type Description
    PdfXfaCaption

    DataSource

    Declaration
    public object DataSource { get; set; }
    Property Value
    Type Description
    System.Object

    Items

    Declaration
    public List<string> Items { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    Padding

    Declaration
    public PdfPaddings Padding { get; set; }
    Property Value
    Type Description
    PdfPaddings

    SelectedIndex

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

    SelectedValue

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

    Methods

    Clone()

    Creates a new object that is a copy of the current instance.

    Declaration
    public object Clone()
    Returns
    Type Description
    System.Object

    The copy of the new object for this instance.

    Examples
    //Create a new XFA document 
    PdfXfaDocument document = new PdfXfaDocument();
    //Create a new XFA form
    PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);     
    //Create a new XFA combo box field
    PdfXfaComboBoxField field = new PdfXfaComboBoxField("combo1", new SizeF(100, 30));
    //Add items.          
    field.Items.Add("One");
    field.Items.Add("Two");
    field.Items.Add("Three");
    field.Items.Add("Four");
    field.Items.Add("Five");
    //Add the field to the form
    form.Fields.Add(field); 
    //Clone the combo box field.
    form.Fields.Add(field.Clone() as PdfXfaComboBoxField);  
    document.XfaForm = form;
    //Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic);
    //Close the document
    document.Close();
    'Create a new XFA document 
    Dim document As New PdfXfaDocument()
    'Create a new XFA form
    Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)      
    'Create a new XFA combo box field
    Dim field As New PdfXfaComboBoxField("combo1", New SizeF(100, 30))
    'Add items.          
    field.Items.Add("One")
    field.Items.Add("Two")
    field.Items.Add("Three")
    field.Items.Add("Four")
    field.Items.Add("Five")
    'Add the field to the form
    form.Fields.Add(field)
    'Clone the combo box field.
    xfaForm.Fields.Add( TryCast(field.Clone(), PdfXfaComboBoxField))  
    document.XfaForm = form
    'Save the document           
    document.Save("output.pdf", PdfXfaType.Dynamic)
    'Close the document
    document.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved