GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    TextBoxFormat Class

    Namespace:
    GemBox.Document.Drawing
    Assembly:
    GemBox.Document.dll

    Represents a set of formatting properties which shall be applied to a TextBox.

    • C#
    • VB.NET
    public sealed class TextBoxFormat
    Public NotInheritable Class TextBoxFormat
    Inheritance:
    System.Object
    TextBoxFormat

    Properties

    AutoFit

    Gets or sets the text auto-fitting setting.

    Default value is None.

    This property is not applicable on a TextBox within a TableCell.

    • C#
    • VB.NET
    public TextAutoFit AutoFit { get; set; }
    Public Property AutoFit As TextAutoFit
    Property Value
    TextAutoFit

    The text auto-fitting setting.

    AutoFitShrinkTextFontScale

    Gets or sets the percentage of the original font size to which each Run in the TextBox is scaled when AutoFit is ShrinkTextOnOverflow.

    Default value is 1 if AutoFit is ShrinkTextOnOverflow; otherwise, System.Double.NaN.

    This property is not applicable on a TextBox within a TableCell.

    • C#
    • VB.NET
    public double AutoFitShrinkTextFontScale { get; set; }
    Public Property AutoFitShrinkTextFontScale As Double
    Property Value
    System.Double

    The percentage of the original font size to which each Run in the TextBox is scaled when AutoFit is ShrinkTextOnOverflow.

    Remarks

    In order to auto-fit text within a bounding box it is sometimes necessary to decrease the font size by a certain percentage. Using this property the font within a text box can be scaled based on the value provided. A value of 1 scales the text to 100%, while a value of 0.01 scales the text to 1%.

    Exceptions
    System.InvalidOperationException

    Property AutoFitShrinkTextFontScale can be set only if property AutoFit is ShrinkTextOnOverflow.

    System.ArgumentOutOfRangeException

    Value is not between 0 and 1.

    AutoFitShrinkTextLineSpaceReduction

    Gets or sets the percentage amount by which the line spacing of each Paragraph in the TextBox is reduced when AutoFit is ShrinkTextOnOverflow.

    This property applies only to paragraphs with percentage line spacing.

    Default value is 0 if AutoFit is ShrinkTextOnOverflow; otherwise, System.Double.NaN.

    This property is not applicable on a TextBox within a TableCell.

    • C#
    • VB.NET
    public double AutoFitShrinkTextLineSpaceReduction { get; set; }
    Public Property AutoFitShrinkTextLineSpaceReduction As Double
    Property Value
    System.Double

    The percentage amount by which the line spacing of each Paragraph in the TextBox is reduced when AutoFit is ShrinkTextOnOverflow.

    Remarks

    The reduction is applied by subtracting it from the original line spacing value. Using this property the vertical spacing between the lines of text can be scaled by a percent amount. A value of 1 reduces the line spacing by 100%, while a value of 0.01 reduces the line spacing by one percent.

    Exceptions
    System.InvalidOperationException

    Property AutoFitShrinkTextLineSpaceReduction can be set only if property AutoFit is ShrinkTextOnOverflow.

    System.ArgumentOutOfRangeException

    Value is not between 0 and 1.

    InternalMargin

    Gets or sets the internal margin.

    • C#
    • VB.NET
    public Padding InternalMargin { get; set; }
    Public Property InternalMargin As Padding
    Property Value
    Padding

    The internal margin.

    TextDirection

    Gets or sets the text direction.

    Default value is Horizontal.

    • C#
    • VB.NET
    public TextDirection TextDirection { get; set; }
    Public Property TextDirection As TextDirection
    Property Value
    TextDirection

    The text direction.

    VerticalAlignment

    Gets or sets the vertical alignment of the text in the TextBox.

    • C#
    • VB.NET
    public VerticalAlignment VerticalAlignment { get; set; }
    Public Property VerticalAlignment As VerticalAlignment
    Property Value
    VerticalAlignment

    The vertical alignment of the text in the TextBox.

    WrapText

    Gets or sets a value indicating whether to wrap text in shape.

    Default value is true.

    This property is not applicable on a TextBox within a TableCell.

    • C#
    • VB.NET
    public bool WrapText { get; set; }
    Public Property WrapText As Boolean
    Property Value
    System.Boolean

    true if words are wrapped within the bounding rectangle; otherwise, false if words spill out without paying attention to the bounding rectangle boundaries.

    Methods

    ToString()

    Returns a System.String that represents this TextBoxFormat instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this TextBoxFormat instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.