Class PdfXfaSelectionMode
Represents the List box selection mode.
Inheritance
System.Object
PdfXfaSelectionMode
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public sealed class PdfXfaSelectionMode : Enum
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a list box field and add the properties.
PdfXfaListBoxField listBoxField = new PdfXfaListBoxField("listBoxField", new SizeF(150, 50));
//Set the caption text.
listBoxField.Caption.Text = "Known Languages";
listBoxField.Caption.Position = PdfXfaPosition.Top;
listBoxField.Caption.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Add the list box items
listBoxField.Items.Add("English");
listBoxField.Items.Add("French");
listBoxField.Items.Add("German");
//Set the selection mode.
listBoxField.SelectionMode = PdfXfaSelectionMode.Single;
//Add the field to the XFA form.
mainForm.Fields.Add(listBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a list box field and add the properties.
Dim listBoxField As New PdfXfaListBoxField("listBoxField", New SizeF(150, 50))
'Set the caption text.
listBoxField.Caption.Text = "Known Languages"
listBoxField.Caption.Position = PdfXfaPosition.Top
listBoxField.Caption.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Add the list box items
listBoxField.Items.Add("English")
listBoxField.Items.Add("French")
listBoxField.Items.Add("German")
'Set the selection mode.
listBoxField.SelectionMode = PdfXfaSelectionMode.Single
'Add the field to the XFA form.
mainForm.Fields.Add(listBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Fields
Multiple
Multiple item selection mode.
Declaration
public const PdfXfaSelectionMode Multiple
Field Value
Type |
---|
PdfXfaSelectionMode |
Single
Single item selection mode.
Declaration
public const PdfXfaSelectionMode Single
Field Value
Type |
---|
PdfXfaSelectionMode |