How to choose from combobox?

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for .NET (v4)  /  How to choose from combobox?

DynamicPDF Merger for .NET (v4) Forum

 Nov 08 2006 5:52 AM
Hello
I can't find any documentation for merger to choose from an combobox field. can you give me some samples?
 Nov 08 2006 6:31 AM
Posted by a ceTe Software moderator
Hello,

The following sample lines of code will show you how to get the selected value from the ComboBox and filling the ComboBox field.

C# Code:

// To get the selected value
// Take a PdfDocument object of the PDF document
PdfDocument pdfDocument =new PdfDocument(@"C:\Temp\DocumentA.pdf");
// Reading the selected value from the ComboBox
string selectedValue = pdfDocument.Form.Fields["combo"].GetValue();

// To set the value for ComboBox
// Take MergeDocument object in order to fill the combobox
MergeDocument document=new MergeDocument(@"C:\Temp\DocumentA.pdf");
// Set the field value
document.Form.Fields["combo"].Value = "Two";

VB.NET Code:

' To get the selected value
' Take a PdfDocument object of the PDF document
 Dim pdfDocument As New PdfDocument("C:\Temp\DocumentA.pdf")
' Reading the selected value from the ComboBox
 Dim selectedValue As String = pdfDocument.Form.Fields("combo").GetValue()

' To set the value for ComboBox
' Take MergeDocument object in order to fill the combobox
 Dim document As New MergeDocument("C:\Temp\DocumentA.pdf")
' Set the field value
 document.Form.Fields("combo").Value = "Two"

You can refer to the Form Filling topic to know more details on filling the forfields and Reading Form Field Values topic to know more about reading the form field values.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 2:28 AM.