menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TextAlign - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TextAlign

    Represents the alignment of the text inside the text block.

    Inheritance
    System.Object
    TextAlign
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class TextAlign : Enum
    Examples
    Node node = new Node()
    {
        // Position of the node
        OffsetX = 250,
        OffsetY = 250,
        // Size of the node
        Width = 100,
        Height = 100,
        Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
        // Initialize annotation collection
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            new ShapeAnnotation 
            { 
                Content = "Node",
                ID = "Annotation",
                 Style= new TextStyle()
                 {
                    TextAlign = TextAlign.Center,
                 }
            }
        },
    };

    Fields

    Center

    Sets the alignment of the text at the center of the text block .

    Declaration
    public const TextAlign Center
    Field Value
    Type
    TextAlign

    Justify

    Sets the alignment of the text in respective to left and right margins.

    Declaration
    public const TextAlign Justify
    Field Value
    Type
    TextAlign

    Left

    Sets the alignment of the text to the left in the text block.

    Declaration
    public const TextAlign Left
    Field Value
    Type
    TextAlign

    Right

    Sets the alignment of the text to the right in the text block.

    Declaration
    public const TextAlign Right
    Field Value
    Type
    TextAlign
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved