AutoSize Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
Description
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.
Syntax
public class AutoSizePublic Class AutoSizeExamples
The following example shows how to set up a TextControl that expands and shrinks horizontally with a maximum size of 600 pixels.
textControl1.ViewMode = TXTextControl.ViewMode.SimpleControl;
textControl1.AutoControlSize.AutoExpand = TXTextControl.AutoSizeDirection.Horizontal;
textControl1.AutoControlSize.AutoShrink = TXTextControl.AutoSizeDirection.Horizontal;
textControl1.AutoControlSize.MaxSize = new Size(600, 600);TextControl1.ViewMode = TXTextControl.ViewMode.SimpleControl
TextControl1.AutoControlSize.AutoExpand = TXTextControl.AutoSizeDirection.Horizontal
TextControl1.AutoControlSize.AutoShrink = TXTextControl.AutoSizeDirection.Horizontal
TextControl1.AutoControlSize.MaxSize = New Size(600, 600)The following example creates an Auto Size instance and configures its auto expand setting for a document workflow.
AutoSize autoSize = new();
autoSize.AutoExpand = AutoSizeDirection.Vertical;Dim autoSize As New AutoSize()
autoSize.AutoExpand = AutoSizeDirection.VerticalMembers
Constructors
| Constructor | Description |
|---|---|
| AutoSize | Initializes a new instance of the AutoSize class. The constructor offers the individual setting of all features. |
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. A control's width or hight cannot be larger than short.MaxValue. |
| MinSize | Gets or sets the minimum size, in pixels, for shrinking the control. A control's width or hight cannot be smaller than the region covered by one character, so that at least one character remains visible. |
Methods
| Method | Description |
|---|---|
| ResetMaxSize | Not described in the reference. public void ResetMaxSize(); |
| ResetMinSize | Not described in the reference. public void ResetMinSize(); |