WinForms

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

    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
    PdfLoadedChoiceField.ObtainSelectedIndex()
    PdfLoadedChoiceField.AssignSelectedIndex(Int32[])
    PdfLoadedChoiceField.ObtainSelectedValue()
    PdfLoadedChoiceField.AssignSelectedValue(String[])
    PdfLoadedChoiceField.Values
    PdfLoadedChoiceField.SelectedItem
    PdfLoadedChoiceField.BackColor
    PdfLoadedChoiceField.ForeColor
    PdfLoadedStyledField.GetGraphicsProperties(PdfLoadedStyledField.GraphicsProperties, PdfLoadedFieldItem)
    PdfLoadedStyledField.DefineDefaultAppearance()
    PdfLoadedStyledField.StyleToString(PdfCheckBoxStyle)
    PdfLoadedStyledField.MouseEnter
    PdfLoadedStyledField.MouseUp
    PdfLoadedStyledField.MouseDown
    PdfLoadedStyledField.MouseLeave
    PdfLoadedStyledField.GotFocus
    PdfLoadedStyledField.LostFocus
    PdfLoadedStyledField.Bounds
    PdfLoadedStyledField.Location
    PdfLoadedStyledField.Size
    PdfLoadedStyledField.BorderStyle
    PdfLoadedStyledField.BorderColor
    PdfLoadedStyledField.BorderWidth
    PdfLoadedStyledField.Font
    PdfLoadedStyledField.DefaultIndex
    PdfLoadedStyledField.Visible
    PdfLoadedStyledField.Visibility
    PdfLoadedStyledField.RotationAngle
    PdfLoadedField.ObjectID
    PdfLoadedField.SetName(String)
    PdfLoadedField.Name
    PdfLoadedField.MappingName
    PdfLoadedField.ToolTip
    PdfLoadedField.Page
    PdfLoadedField.ReadOnly
    PdfLoadedField.Required
    PdfLoadedField.Export
    PdfLoadedField.Form
    PdfField.GetValue(String)
    PdfField.SetValue(String, String)
    PdfField.Initialize()
    PdfField.Flatten
    PdfField.DisableAutoFormat
    PdfField.PdfTag
    PdfField.TabIndex
    PdfField.Layer
    PdfField.PropertyChanged
    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.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 Description
    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 Description
    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 Description
    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 Description
    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)

    Methods

    Remove(PdfLoadedComboBoxItem)

    Declaration
    public void Remove(PdfLoadedComboBoxItem item)
    Parameters
    Type Name Description
    PdfLoadedComboBoxItem item

    RemoveAt(Int32)

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

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