TXTextControl.AutoSize Class

The AutoSize class is used with the TextControl.AutoControlSize property, to enable automatic expansion or shrinking of a Text Control's width or height. Additionally, it contains properties for setting maximum and minimum values. Automatic expansion or shrinking is only possible, if the TextControl.ViewMode property has been set to SimpleControl.

Introduced: 11.0.

Syntax

[C#]
public class AutoSize
[Visual Basic]
Public Class AutoSize

Constructors

Constructor Description
AutoSize Initializes a new instance of the AutoSize class.

Properties

Property Description
AutoExpand Gets or sets possible directions for expanding the control.
AutoShrink Gets or sets possible directions for shrinking the control.
MaxSize Gets or sets the maximum size, in pixels, for expanding the control.
MinSize Gets or sets the minimum size, in pixels, for shrinking the control.

Example

The following example shows how to set up a TextControl that expands and shrinks horizontally with a maximum size of 600 pixels.

[C#]
textControl1.ViewMode = TXTextControl.ViewMode.SimpleControl;
textControl1.AutoControlSize.AutoExpand = TXTextControl.AutoSizeDirection.Horizontal;
textControl1.AutoControlSize.AutoShrink = TXTextControl.AutoSizeDirection.Horizontal;
textControl1.AutoControlSize.MaxSize = new Size(600, 600);
[Visual Basic]
TextControl1.ViewMode = TXTextControl.ViewMode.SimpleControl
TextControl1.AutoControlSize.AutoExpand = TXTextControl.AutoSizeDirection.Horizontal
TextControl1.AutoControlSize.AutoShrink = TXTextControl.AutoSizeDirection.Horizontal
TextControl1.AutoControlSize.MaxSize = New Size(600, 600)

See Also