Description
The TextAlign.Center
field is a member of the TextAlign
enumeration within the Sandbox.UI
namespace. It specifies that text should be aligned to the horizontal center of its containing element. This is typically used in UI components to control the alignment of text content.
Usage
Use TextAlign.Center
when you want to center-align text within a UI element. This can be particularly useful for creating balanced and aesthetically pleasing layouts where text needs to be centered within its container.
Example
// Example of using TextAlign.Center in a UI component
var label = new Label();
label.Text = "Centered Text";
label.TextAlign = TextAlign.Center;