How to disable combobox in PDF

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v11)  /  How to disable combobox in PDF

DynamicPDF CoreSuite for .NET (v11) Forum

 Nov 22 2021 12:23 AM
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
 Nov 22 2021 2:39 PM
Posted by a ceTe Software moderator
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
 Nov 23 2021 12:22 AM
If I set ReadOnly =true , then combobox look like textbox . why ? it is not happens in our old tool.
 Nov 24 2021 10:26 AM
Posted by a ceTe Software moderator
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

All times are US Eastern Standard time. The time now is 1:41 AM.