TextBoxFormat Class
Represents a set of formatting properties which shall be applied to a TextBox.
- Inheritance:
- System.ObjectTextBoxFormat
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.
Property Value
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.
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.
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.
Property Value
The internal margin.
TextDirection
Gets or sets the text direction.
Default value is Horizontal.
public TextDirection TextDirection { get; set; }
Public Property TextDirection As TextDirection
Property Value
The text direction.
VerticalAlignment
Gets or sets the vertical alignment of the text in the TextBox.
public VerticalAlignment VerticalAlignment { get; set; }
Public Property VerticalAlignment As VerticalAlignment
Property Value
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.
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.
Returns
- System.String
A System.String that represents this TextBoxFormat instance.
Overrides
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).