WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TextNode - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TextNode

    Base class for text nodes and labels.

    Inheritance
    System.Object
    Node
    TextNode
    Implements
    IUnitIndependent
    IDispatchNodeEvents
    System.Runtime.Serialization.ISerializable
    INode
    System.ICloneable
    IServiceReferenceHolder
    IServiceReferenceProvider
    IPropertyObserver
    IPropertyContainer
    System.IServiceProvider
    IGraphNode
    System.Runtime.Serialization.IDeserializationCallback
    System.IDisposable
    Inherited Members
    Node.m_rgnCache
    Node.m_fRotationAngle
    Node.m_mgrHistory
    Node.m_eventSink
    Node.m_mgrLink
    Node.m_mgrBridge
    Node.m_bLockUpdate
    Node.m_rectRefresh
    Node.m_bPortUpdating
    Node.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
    Node.UpdateServiceReferences(IServiceReferenceProvider)
    Node.ProvideServiceReference(RuntimeTypeHandle)
    Node.GetPropertyContainerByName(String)
    Node.OnPropertyChanging(String, String, Object)
    Node.OnPropertyChanged(String, String)
    Node.Draw(Graphics)
    Node.Draw(Graphics, Boolean)
    Node.PrepareGraphics(Graphics)
    Node.RenderContiguousData(Graphics)
    Node.ContainsPoint(PointF)
    Node.ShowResizeHandles()
    Node.Translate(Single, Single, MeasureUnits)
    Node.Translate(Single, Single)
    Node.Rotate(Single)
    Node.Scale(Single, Single)
    Node.AppendFlipTransforms(Matrix)
    Node.AppendLocalFlipTransforms(Matrix)
    Node.GetTransformations()
    Node.GetLocalTransformations()
    Node.GetParentTransformation(Boolean)
    Node.AppendFlipTransforms(Matrix, PointF, Boolean, Boolean)
    Node.GetTransformations(PointF, SizeF, Single)
    Node.OnMeasurementUnitsChanging(MeasureUnits)
    Node.QuiteBoundarySet(Boolean)
    Node.DoPinOffsetRelatedActions(SizeF, SizeF)
    Node.DoSizeRelatedActions(SizeF, SizeF)
    Node.DoMoveRelatedActions(Single, Single)
    Node.SafeHistoryPause()
    Node.SafeHistoryResume()
    Node.OnNodeScaleChanged(String)
    Node.UpdateBoundingRectangle()
    Node.GetNodeBounds(Boolean, Boolean)
    Node.GetRectBounds(Boolean, Boolean)
    Node.GetPathBounds()
    Node.UpdateRefreshRect()
    Node.UpdateRefreshRect(RectangleF, Matrix)
    Node.AccumulateRefreshRect(RectangleF)
    Node.GetScaleTransformation()
    Node.ConvertToNodeCoordinates(PointF)
    Node.ConvertToModelCoordinates(PointF)
    Node.Move(Single, Single)
    Node.ChangeFlipX(Boolean)
    Node.ChangeFlipY(Boolean)
    Node.ChangeRotationBy(Single)
    Node.SetPinOffset(SizeF, SizeF)
    Node.SetSize(SizeF, SizeF)
    Node.OnParentChanging()
    Node.OnParentChanged()
    Node.LogicalUnitChange(GraphicsUnit)
    Node.UpdateHelperRegion()
    Node.CanWiden(GraphicsPath)
    Node.OnMouseClick(EventArgs)
    Node.OnMouseDoubleClick(EventArgs)
    Node.OnMouseEnter(EventArgs)
    Node.OnMouseLeave(EventArgs)
    Node.SetPinPoint(PointF, MeasureUnits)
    Node.EventSink_PropertyChanging(PropertyChangingEventArgs)
    Node.EventSink_PropertyChanged(PropertyChangedEventArgs)
    Node.CreateBoundsInfo()
    Node.CreateBoundsInfo(PointF, SizeF, SizeF)
    Node.CreateBoundsInfo(BoundsInfo)
    Node.CreateBoundsInfo(BoundsInfo, PageScale)
    Node.UpdatePortPositions(SizeF, SizeF)
    Node.UpdateContainerBounds()
    Node.CanUpdateConnections(EndPoint)
    Node.IsClosedPath(GraphicsPath)
    Node.GetBoundsRect(Node)
    Node.UpdateGraphicsPath(SizeF, SizeF)
    Node.GetUpperLeftPoint(MeasureUnits)
    Node.RecordPropertyChanged(String)
    Node.CheckConstrainingRegion(PointF)
    Node.CheckConstrainingRegion(RectangleF)
    Node.CheckNewPinPoint(PointF, MeasureUnits)
    Node.GetService(Type)
    Node.IUnitIndependent.GetPinPoint(MeasureUnits)
    Node.IUnitIndependent.GetSize(MeasureUnits)
    Node.IUnitIndependent.GetPinPointOffset(MeasureUnits)
    Node.IUnitIndependent.GetBoundingRectangle(MeasureUnits, Boolean)
    Node.IUnitIndependent.SetPinPoint(PointF, MeasureUnits)
    Node.IUnitIndependent.SetSize(SizeF, MeasureUnits)
    Node.IUnitIndependent.SetPinPointOffset(SizeF, MeasureUnits)
    Node.IDispatchNodeEvents.Click(EventArgs)
    Node.IDispatchNodeEvents.DoubleClick(EventArgs)
    Node.IDispatchNodeEvents.MouseEnter(EventArgs)
    Node.IDispatchNodeEvents.MouseLeave(EventArgs)
    Node.IDeserializationCallback.OnDeserialization(Object)
    Node.OnDeserialized()
    Node.AllowLabelDrag
    Node.TreatAsObstacle
    Node.PrintPorts
    Node.DrawPorts
    Node.Ports
    Node.ZOrder
    Node.EnableCentralPort
    Node.CentralPort
    Node.Tag
    Node.ExcludeFromLayout
    Node.IsExpanded
    Node.Name
    Node.FullName
    Node.Container
    Node.Parent
    Node.Root
    Node.Visible
    Node.Layers
    Node.LineHitTestPadding
    Node.MeasurementUnit
    Node.InheritContainerMeasureUnits
    Node.LogicalGraphicsPath
    Node.GraphicsPath
    Node.HistoryManager
    Node.EventSink
    Node.PropertyBag
    Node.ToolTipText
    Node.RefreshRect
    Node.BoundingRect
    Node.BoundsInfo
    Node.BoundingRectangle
    Node.Size
    Node.PinPointOffset
    Node.PinPoint
    Node.NodeScale
    Node.ShadowStyle
    Node.LineStyle
    Node.EditStyle
    Node.RotationAngle
    Node.FlipX
    Node.FlipY
    Node.FullContainerName
    Node.INode.Root
    Node.Edges
    Node.EdgesEntering
    Node.EdgesLeaving
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Diagram
    Assembly: Syncfusion.Diagram.Base.dll
    Syntax
    public class TextNode : Node, IUnitIndependent, IDispatchNodeEvents, ISerializable, INode, ICloneable, IServiceReferenceHolder, IServiceReferenceProvider, IPropertyObserver, IPropertyContainer, IServiceProvider, IGraphNode, IDeserializationCallback, IDisposable

    Constructors

    TextNode(TextNode)

    Initializes a new instance of the TextNode class.

    Declaration
    public TextNode(TextNode src)
    Parameters
    Type Name Description
    TextNode src

    The text node source.

    TextNode(SerializationInfo, StreamingContext)

    Initializes a new instance of the TextNode class.

    Declaration
    protected TextNode(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    The info.

    System.Runtime.Serialization.StreamingContext context

    The context.

    TextNode(String)

    Initializes a new instance of the TextNode class.

    Declaration
    public TextNode(string strText)
    Parameters
    Type Name Description
    System.String strText

    The text.

    TextNode(String, RectangleF)

    Initializes a new instance of the TextNode class.

    Declaration
    public TextNode(string strText, RectangleF rectBounds)
    Parameters
    Type Name Description
    System.String strText

    The text.

    System.Drawing.RectangleF rectBounds

    The rect bounds.

    TextNode(String, RectangleF, MeasureUnits)

    Initializes a new instance of the TextNode class.

    Declaration
    public TextNode(string strText, RectangleF rectBounds, MeasureUnits measureUnits)
    Parameters
    Type Name Description
    System.String strText

    The text.

    System.Drawing.RectangleF rectBounds

    The rect bounds.

    MeasureUnits measureUnits

    The measure units.

    Properties

    BackgroundStyle

    Gets text background style.

    Declaration
    public FillStyle BackgroundStyle { get; }
    Property Value
    Type Description
    FillStyle

    DirectionRightToLeft

    Gets or sets a value indicating whether the text is right to left.

    Declaration
    public bool DirectionRightToLeft { get; set; }
    Property Value
    Type Description
    System.Boolean

    DirectionVertical

    Gets or sets a value indicating whether the text is vertical.

    Declaration
    public bool DirectionVertical { get; set; }
    Property Value
    Type Description
    System.Boolean

    FitBlackBox

    Gets or sets a value indicating whether no part of any glyph overhangs the bounding rectangle.

    Declaration
    public bool FitBlackBox { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    By default some glyphs overhang the rectangle slightly where necessary to appear at the edge visually. For example when an italic lowercase letter f in a font such as Garamond is aligned at the far left of a rectangle, the lower part of the f will reach slightly further left than the left edge of the rectangle. Setting this flag will ensure no painting outside the rectangle but will cause the aligned edges of adjacent lines of text to appear uneven.

    FontColorStyle

    Gets font color style.

    Declaration
    public FillStyle FontColorStyle { get; }
    Property Value
    Type Description
    FillStyle

    FontStyle

    Gets the font used to draw the text.

    Declaration
    public FontStyle FontStyle { get; }
    Property Value
    Type Description
    FontStyle

    FormatFlags

    Gets flags used to format the text.

    Declaration
    public StringFormatFlags FormatFlags { get; }
    Property Value
    Type Description
    System.Drawing.StringFormatFlags
    Remarks

    See System.Drawing.StringFormatFlags for more details.

    HorizontalAlignment

    Specifies how an object or text in a control is horizontally aligned relative to an element of the control.

    Declaration
    public StringAlignment HorizontalAlignment { get; set; }
    Property Value
    Type Description
    System.Drawing.StringAlignment
    Remarks

    This property is used by the GetStringFormat() method to generate a System.Drawing.StringFormat object. This property corresponds to the Alignment property in the System.Drawing.StringFormat class.

    LineLimit

    Gets or sets a value indicating whether only entire lines are laid out in the formatting rectangle.

    Declaration
    public bool LineLimit { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    By default, layout continues until the end of the text, or until no more lines are visible as a result of clipping, whichever comes first. Note that the default settings allow the last line to be partially obscured by a formatting rectangle that is not a whole multiple of the line height. To ensure that only whole lines are seen, specify this value and be careful to provide a formatting rectangle at least as tall as the height of one line.

    MeasureTrailingSpaces

    Gets or sets a value indicating whether space at the end of each line in calculations that measure the size of the text.

    Declaration
    public bool MeasureTrailingSpaces { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    By default, the boundary rectangle returned by the MeasureString method excludes the space at the end of each line. Set this flag to include that space in measurement.

    NoClip

    Gets or sets a value indicating whether overhanging parts of glyphs and unwrapped text reaching outside the formatting rectangle are allowed to show.

    Declaration
    public bool NoClip { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    By default, all text and glyph parts reaching outside the formatting rectangle are clipped.

    ReadOnly

    Gets or sets a value indicating whether the text object is Read-only or not.

    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    Text

    Gets or sets the value contained by the text object.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    Derived classes override this property in order to supply the text value in an implementation-specific way.

    TextCase

    Gets or sets case of text in the RichTextNode

    Declaration
    public TextCases TextCase { get; set; }
    Property Value
    Type Description
    TextCases

    VerticalAlignment

    Gets or sets the vertical alignment of the text.

    Declaration
    public StringAlignment VerticalAlignment { get; set; }
    Property Value
    Type Description
    System.Drawing.StringAlignment
    Remarks

    This property is used by the GetStringFormat() method to generate a System.Drawing.StringFormat object. This property corresponds to the LineAlignment property in the System.Drawing.StringFormat class.

    WrapText

    Gets or sets a value indicating whether text should be wrapped when it exceeds the width of the bounding box.

    Declaration
    public bool WrapText { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Clone()

    Creates a new object that is a copy of the current instance.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    A new object that is a copy of this instance.

    Overrides
    Node.Clone()

    Dispose()

    Declaration
    public override void Dispose()
    Overrides
    Node.Dispose()

    GetObjectData(SerializationInfo, StreamingContext)

    Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.

    Declaration
    protected override void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    The System.Runtime.Serialization.SerializationInfo to populate with data.

    System.Runtime.Serialization.StreamingContext context

    The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.

    Overrides
    Node.GetObjectData(SerializationInfo, StreamingContext)
    Exceptions
    Type Condition
    System.Security.SecurityException

    The caller does not have the required permission.

    GetPropertyContainer(String)

    Gets the property container.

    Declaration
    protected override object GetPropertyContainer(string strPropertyContainerName)
    Parameters
    Type Name Description
    System.String strPropertyContainerName

    Name of the property container.

    Returns
    Type Description
    System.Object

    Property container.

    Overrides
    Node.GetPropertyContainer(String)

    GetStringFormat()

    Creates a StringFormat object that encapsulates the properties of the text object.

    Declaration
    public StringFormat GetStringFormat()
    Returns
    Type Description
    System.Drawing.StringFormat

    System.Drawing.StringFormat object.

    Remarks

    The System.Drawing.StringFormat object returned by this method is used to draw the text using the System.Drawing.Graphics.DrawString method.

    Render(Graphics)

    Renders shapes visual representation on given graphics.

    Declaration
    protected override void Render(Graphics gfx)
    Parameters
    Type Name Description
    System.Drawing.Graphics gfx

    Graphics to draw on

    Overrides
    Node.Render(Graphics)

    SizeToText(Graphics, SizeF)

    Adjusts the size of the bounding box to fit the text.

    Declaration
    public SizeF SizeToText(Graphics grfx, SizeF layoutArea)
    Parameters
    Type Name Description
    System.Drawing.Graphics grfx

    Graphics context used to measure the text.

    System.Drawing.SizeF layoutArea

    Maximum layout size of the string.

    Returns
    Type Description
    System.Drawing.SizeF

    New size of the bounding box.

    Remarks

    Uses the System.Drawing.Graphics.MeasureString method to calculate the size of the bounding box based on the font and text value.

    SizeToText(SizeF)

    Adjusts the size of the bounding box to fit the text.

    Declaration
    public SizeF SizeToText(SizeF layoutArea)
    Parameters
    Type Name Description
    System.Drawing.SizeF layoutArea

    Maximum layout size of the string.

    Returns
    Type Description
    System.Drawing.SizeF

    New size of the bounding box.

    Remarks

    Uses the System.Drawing.Graphics.MeasureString method to calculate the size of the bounding box based on the font and text value.

    UpdateReferences(IServiceReferenceProvider)

    Updates the references.

    Declaration
    public override void UpdateReferences(IServiceReferenceProvider provider)
    Parameters
    Type Name Description
    IServiceReferenceProvider provider

    The provider.

    Overrides
    Node.UpdateReferences(IServiceReferenceProvider)

    Implements

    IUnitIndependent
    IDispatchNodeEvents
    System.Runtime.Serialization.ISerializable
    INode
    System.ICloneable
    IServiceReferenceHolder
    IServiceReferenceProvider
    IPropertyObserver
    IPropertyContainer
    System.IServiceProvider
    IGraphNode
    System.Runtime.Serialization.IDeserializationCallback
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved