How to disable combobox in PDF

How to disable combobox in PDF

Forum member · Nov 22, 2021
We have combobox (Form element) on PDF and set Editable=false , but still user able to select combobox and PDF is asking "save changes" when he closing it. ComboBox comboBox = new ComboBox(comboboxElement.Name, document.CurrentX, document.CurrentY, comboboxElement.Width, comboboxElement.Height) { Font = PdfDocumentHelper.GetFont(comboboxElement.FontType), FontSize = comboboxElement.FontSize, TextColor = new WebColor(comboboxElement.TextColorCode), BackgroundColor = new WebColor(comboboxElement.BackgroundColorCode), BorderStyle = PdfDocumentHelper.GetElementBorderStyle(comboboxElement.BorderStyle) }; comboBox.BorderStyle.Thickness = PdfDocumentHelper.GetElementBorderThickness(comboboxElement.BorderThickness); comboBox.BorderColor = new WebColor(comboboxElement.BorderColorCode); foreach (var item in comboboxElement.ItemsList) { comboBox.Items.Add(item); } comboBox.Items[0].Selected=true; comboBox.ToolTip = comboBox.Items[0].ItemName; comboBox.Editable = comboboxElement.Editable; here comboboxElement is our properties class

Re: How to disable combobox in PDF

Support · Nov 22, 2021
Hi, Setting the Editable property will allow users to edit the combobox item's text. If you set it to false then item names will not be editable, but the end user can select any item in the list. If you do not want for the end user to select any item, then try setting the ReadOnly property to true. comboBoxObj.ReadOnly = true; Thanks, ceTe Software Support Team

Re: How to disable combobox in PDF

Forum member · Nov 23, 2021
If I set ReadOnly =true , then combobox look like textbox . why ? it is not happens in our old tool.

Re: How to disable combobox in PDF

Support · Nov 24, 2021
Hi, If it is read only, no action can be taken on it, so it looks similar to a text box. Regarding older tool behavior, please send a copy of the output from the old tool to support@dynamicpdf.com and we will be happy to investigate it further. Please add a link to this forum post in your email to support. Thanks, ceTe Software Support Team