The Acrofroms API supports changing visual properties of fields, such as color, border, and text information. These are properties of the Field and WidgetAnnotation.
The visual appearance of a widget annotation can be changed through the BorderStyle, BorderColor, BorderWidth and FillColor properties of a widget annotation.
Example border styles:
C# Example |
Copy Code |
---|---|
void ModifyWidgetProperties(Field field) { foreach(WidgetAnnotation widget in field.Widgets) { // Set some fill and border colors. widget.FillColor = Color.Red; widget.BorderColor = Color.YellowGreen; // Set a thick border width (size 3). // Any integer can also be used. widget.BorderWidth = AnnotationBorderWidth.THICK; // Set a border style. widget.BorderStyle = AnnotationBorderStyle.DASHED; } } |
Fields with variable text have the ability to modify the FontName, FontSize, and TextColor of the displayed textual value.
Example FontName, FontSize, and TextColor applications to TextField:
C# Example |
Copy Code |
---|---|
void ModifyTextProperties(TextField field) { // Set some font settings. field.FontName = "Helvetica"; field.FontSize = 22; // Color the text. field.TextColor = Color.BlanchedAlmond; } |