Hello,
I am unable to find a way to set text to auto size text font when a field is being edited for
- ComboBoxes
- Text Boxes
Here is a snipped of code for text box but I will also need the equivalent for a editable combobox. I also need to make sure that it does this fix does not also include the bug from ticket
PDFNET-41594
public void CreateTextBoxFieldWithBorderStyle(Document doc, Rectangle txtBoxSize, Point pointPosition, string partialName,
bool scrollable, bool multiline, double fontSize, string fontName, HorizontalAlignment horiAlign,
int maxLen, ColorEnum.Color? fontColor, bool hasBorder, ColorEnum.Color? borderColor, bool hasBorderStyle, BorderStyle borderStyle)
{
TextBoxField txtBox = new TextBoxField(doc, txtBoxSize);
txtBox.SetPosition(pointPosition);
txtBox.PartialName = partialName;
txtBox.Scrollable = scrollable;
txtBox.Multiline = multiline;
txtBox.DefaultAppearance.FontSize = fontSize;
txtBox.DefaultAppearance.FontName = fontName;
txtBox.TextHorizontalAlignment = horiAlign;
txtBox.MaxLen = maxLen;
if (hasBorder)
{
Border border = new Border(txtBox);
border.Width = 1;
border.Dash = new Dash(1, 1);
if (hasBorderStyle)
{
border.Style = borderStyle;
}
if (borderColor != null)
{
switch (borderColor)
{
case ColorEnum.Color.Black:
txtBox.Characteristics.Border = System.Drawing.Color.Black;
break;
case ColorEnum.Color.Gray:
txtBox.Characteristics.Border = System.Drawing.Color.Gray;
break;
case ColorEnum.Color.LightGray:
txtBox.Characteristics.Border = System.Drawing.Color.LightGray;
break;
}
}
txtBox.Border = border;
}
switch (fontColor)
{
case ColorEnum.Color.Black:
txtBox.Color = Color.FromRgb(System.Drawing.Color.Black);
break;
case ColorEnum.Color.Gray:
txtBox.Color = Color.FromRgb(System.Drawing.Color.Gray);
break;
}
doc.Form.Add(txtBox, 1);
My organization (Florida Senate) have since purchased Enterprise support and I have been asked to escalate this ticket using our paid enterprise support. Please and thank you.