WordBreak BreakAll

robot_2Generated
code_blocksInput

Description

The BreakAll field is a member of the WordBreak enumeration within the Sandbox.UI namespace. It specifies that overflowing lines should break at the closest character, rather than at word boundaries. This is useful for ensuring that text fits within a given space, even if it means breaking words in the middle.

Usage

Use WordBreak.BreakAll when you need to control text overflow behavior in UI elements, particularly when dealing with languages or content where breaking at word boundaries is not feasible or desired. This setting is typically applied to UI components that render text, ensuring that the text does not overflow its container.

Example

// Example of using WordBreak.BreakAll in a UI component
var label = new Label();
label.Text = "This is a very long text that might not fit in the container.";
label.Style.WordBreak = WordBreak.BreakAll;

// This will ensure that the text breaks at the nearest character if it overflows the container.