Table of Contents

Property ConstrainToSize

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

ConstrainToSize

Gets or sets the width and height Text will be constrained to when formatted.

public Size? ConstrainToSize { get; set; }

Property Value

Size?

Remarks

Does not return the size of the formatted text but the size that will be used to constrain the text when formatted.

If null both the width and height will be unconstrained and text will be formatted to the size of the text.

Setting this property is the same as setting ConstrainToWidth and ConstrainToHeight separately.

Use FormatAndGetSize(Size?) to get the size of the formatted text.

When set, NeedsFormat is set to true.