menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLoadedComboBoxField - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfLoadedComboBoxField

    Represents the combo box field of an existing item.

    Inheritance
    System.Object
    PdfField
    PdfLoadedField
    PdfLoadedStyledField
    PdfLoadedChoiceField
    PdfLoadedComboBoxField
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfField.DisableAutoFormat
    PdfField.Flatten
    PdfField.GetValue(String)
    PdfField.Initialize()
    PdfField.Layer
    PdfField.PdfTag
    PdfField.PropertyChanged
    PdfField.SetValue(String, String)
    PdfField.TabIndex
    PdfLoadedChoiceField.AssignSelectedIndex(Int32[])
    PdfLoadedChoiceField.AssignSelectedValue(String[])
    PdfLoadedChoiceField.BackColor
    PdfLoadedChoiceField.ForeColor
    PdfLoadedChoiceField.ObtainSelectedIndex()
    PdfLoadedChoiceField.ObtainSelectedValue()
    PdfLoadedChoiceField.SelectedItem
    PdfLoadedChoiceField.Values
    PdfLoadedField.Export
    PdfLoadedField.Form
    PdfLoadedField.MappingName
    PdfLoadedField.Name
    PdfLoadedField.ObjectID
    PdfLoadedField.Page
    PdfLoadedField.ReadOnly
    PdfLoadedField.Required
    PdfLoadedField.SetName(String)
    PdfLoadedField.ToolTip
    PdfLoadedStyledField.BorderColor
    PdfLoadedStyledField.BorderStyle
    PdfLoadedStyledField.BorderWidth
    PdfLoadedStyledField.Bounds
    PdfLoadedStyledField.DefaultIndex
    PdfLoadedStyledField.DefineDefaultAppearance()
    PdfLoadedStyledField.Font
    PdfLoadedStyledField.GetGraphicsProperties(PdfLoadedStyledField.GraphicsProperties, PdfLoadedFieldItem)
    PdfLoadedStyledField.GotFocus
    PdfLoadedStyledField.Location
    PdfLoadedStyledField.LostFocus
    PdfLoadedStyledField.MouseDown
    PdfLoadedStyledField.MouseEnter
    PdfLoadedStyledField.MouseLeave
    PdfLoadedStyledField.MouseUp
    PdfLoadedStyledField.RotationAngle
    PdfLoadedStyledField.Size
    PdfLoadedStyledField.StyleToString(PdfCheckBoxStyle)
    PdfLoadedStyledField.Visibility
    PdfLoadedStyledField.Visible
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Parsing
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLoadedComboBoxField : PdfLoadedChoiceField, IPdfWrapper, INotifyPropertyChanged
    Examples
    //Load an existing document.
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read a combo box field
    PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
    comboField.SelectedIndex = 0;
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    'Read a combo box field
    Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
    comboField.SelectedIndex = 0
    doc.Save("Form.pdf")
    doc.Close(True)

    Properties

    ComplexScript

    Gets or sets the complex script language support.

    Declaration
    public bool ComplexScript { get; set; }
    Property Value
    Type
    System.Boolean
    Examples
    //Load existing PDF document.
    PdfLoadedDocument ldoc = new PdfLoadedDocument("form.pdf");
    //Load the existing combo box field.
    PdfLoadedComboBoxField combo = lfied as PdfLoadedComboBoxField;
    //Create font.
    Font font = new Font("Tahoma", 10f);
    //Create a new PDF font instance.
    PdfFont pdfFont = new PdfTrueTypeFont(font, FontStyle.Regular, 10f, true, true);
    //Set font.
    combo.Font = pdfFont;
    //Enable complex script support.
    combo.ComplexScript = true;
    ldoc.Form.SetDefaultAppearance(false);
    //Save the document.
    ldoc.Save("output.pdf");
    //Close the document.
    ldoc.Close(true);
    'Load existing PDF document.
    Dim ldoc As New PdfLoadedDocument("form.pdf")
    'Load the existing combo box field.
    Dim combo As PdfLoadedComboBoxField = TryCast(ldoc.Form.Fields(0), PdfLoadedComboBoxField)
    'Create font.
    Dim font As New Font("Tahoma", 10F)
    'Create a new PDF font instance.
    Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, FontStyle.Regular, 10F, True, True)
    'Set font.
    combo.Font = pdfFont
    'Enable complex script support.
    combo.ComplexScript = True
    ldoc.Form.SetDefaultAppearance(False)
    'Save the document.
    ldoc.Save("output.pdf")
    'Close the document.
    ldoc.Close(True)

    Editable

    Gets or sets a value indicating whether this PdfComboBoxField is editable.

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

    True if the drop down list is editable, false otherwise. Default is false.

    Examples
    //Load an existing document.
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Load an existing combo field
    PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
    comboField.Editable = false;
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    'Load an existing Check field
    Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
    comboField.Editable = False    
    doc.Save("Form.pdf")
    doc.Close(True)
    See Also
    PdfLoadedListItem
    PdfLoadedDocument

    Items

    Gets the collection of combo box items.[Read-Only]

    Declaration
    public PdfLoadedComboBoxItemCollection Items { get; }
    Property Value
    Type
    PdfLoadedComboBoxItemCollection
    Examples
    //Load an existing document.
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");           
    // Load an existing combo field
    PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
    // Load combo field collection
    PdfLoadedComboBoxItemCollection comboCollection = comboField.Items;
    // Reading first item of the collection.
    PdfLoadedComboBoxItem item = comboCollection[0];
    item.Location = new PointF(200, 200);
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document.
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    'Load an existing combo field
    Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
    'Load combo field collection
    Dim comboCollection As PdfLoadedComboBoxItemCollection = comboField.Items
    'Reading first item of the collection.
    Dim item As PdfLoadedComboBoxItem = comboCollection(0)
    item.Location = New PointF(200, 200)
    doc.Save("Form.pdf")
    doc.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedComboBoxItem

    SelectedIndex

    Gets or sets the index which is to be selected.

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type
    System.Int32
    Examples
    //Load an existing document.
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read a combo box field
    PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
    comboField.SelectedIndex = 0;
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    'Read a combo box field
    Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
    comboField.SelectedIndex = 0
    doc.Save("Form.pdf")
    doc.Close(True)

    SelectedValue

    Gets or sets the value which is to be selected.

    Declaration
    public string SelectedValue { get; set; }
    Property Value
    Type
    System.String
    Examples
    //Load an existing document.
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read a combo box field
    PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
    comboField.SelectedValue = "Employee";
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    'Read a combo box field
    Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
    comboField.SelectedValue = "Employee"
    doc.Save("Form.pdf")
    doc.Close(True)

    TextAlignment

    Gets or sets the text alignment.

    Declaration
    public PdfTextAlignment TextAlignment { get; set; }
    Property Value
    Type
    PdfTextAlignment
    Examples
    // Load an existing document.
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Load an existing combo box field by its name.
    PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
    // Set text alignment to center for the combo box field.
    comboField.TextAlignment = PdfTextAlignment.Center;
    // Save the updated document.
    doc.Save("Form.pdf");
    doc.Close(true);
    ' Load an existing document.
    Dim doc As New PdfLoadedDocument("SourceForm.pdf")
    ' Load an existing combo box field by its name.
    Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
    ' Set text alignment to center for the combo box field.
    comboField.TextAlignment = PdfTextAlignment.Center
    ' Save the updated document.
    doc.Save("Form.pdf")
    doc.Close(True)

    Methods

    Remove(PdfLoadedComboBoxItem)

    Remove the particular PdfLoadedComboBoxItem from PdfLoadedComboBoxField.

    Declaration
    public void Remove(PdfLoadedComboBoxItem item)
    Parameters
    Type Name Description
    PdfLoadedComboBoxItem item
    Examples
     //Load an existing document
     PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");       
     //Get the loaded form.
      PdfLoadedForm loadedForm = loadedDocument.Form;
     //Get the comboBoxField
     PdfLoadedComboBoxField comboBoxField = loadedForm.Fields[0] as PdfLoadedComboBoxField;
     //Get the comboBoxfield item
     PdfLoadedComboBoxItem comboBoxFieldItem = comboBoxField.Items[0] as PdfLoadedComboBoxItem;
    //Remove the ComboBoxItem
     loadedField.Remove(comboBoxFieldItem); 
     //Save the modified document.
     loadedDocument.Save("form.pdf");
    //Close the document
    loadedDocument.Close(true);

    RemoveAt(Int32)

    Remove the PdfLoadedComboBoxField item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Examples
     //Load an existing document
     PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");        
     //Get the loaded form.
      PdfLoadedForm loadedForm = loadedDocument.Form;
     //Get the comboBoxField 
     PdfLoadedComboBoxField comboBoxField = loadedForm.Fields[0] as PdfLoadedComboBoxField;       
    //Remove the comboBoxField item
     comboBoxField.RemoveAt(0);
    //Save the modified document.
     loadedDocument.Save("form.pdf");
    //Close the document
    loadedDocument.Close(true);

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfLoadedChoiceField
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved