menu

WinForms

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

    Show / Hide Table of Contents

    Class TextEdit

    The TextEdit is used to provide interactive editing actions for text objects of TextNode/RichTextNode in Diagram control.

    Inheritance
    System.Object
    TextEdit
    Implements
    ITextEditor
    Namespace: Syncfusion.Windows.Forms.Diagram
    Assembly: Syncfusion.Diagram.Windows.dll
    Syntax
    public class TextEdit : TextBox, ITextEditor
    Remarks

    This class implements a text box control that is used for editing text nodes derived from the TextNode.

    TextNode

    Constructors

    TextEdit(IViewer)

    Initializes a new instance of the TextEdit class.

    Declaration
    public TextEdit(IViewer view)
    Parameters
    Type Name Description
    IViewer view

    View that is hosting the text edit control.

    TextEdit(IViewer, Boolean)

    Initializes a new instance of the TextEdit class.

    Declaration
    public TextEdit(IViewer view, bool autoResize)
    Parameters
    Type Name Description
    IViewer view

    View that is hosting the text edit control.

    System.Boolean autoResize

    Flag indicating if text box should be automatically resized.

    TextEdit(IViewer, SizeF, Boolean)

    Initializes a new instance of the TextEdit class.

    Declaration
    public TextEdit(IViewer view, SizeF maxSize, bool autoResize)
    Parameters
    Type Name Description
    IViewer view

    View that is hosting the text edit control.

    System.Drawing.SizeF maxSize

    Maximum size the text can grow to.

    System.Boolean autoResize

    Flag indicating if text box should be automatically resized.

    Properties

    AutoResize

    Gets or sets a value indicating whether text box should be automatically resized.

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

    Bold

    Gets or sets a value that indicates whether this Font is bolded in the Diagram control TextEditor.

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

    CharOffset

    Gets or sets char offset. Not used in TextNode.

    Declaration
    public int CharOffset { get; set; }
    Property Value
    Type
    System.Int32

    CurrentText

    Gets or sets the current contents of the text editor.

    Declaration
    public string CurrentText { get; set; }
    Property Value
    Type
    System.String

    FontFamily

    Gets or sets to specify the font name for a text of text node in Diagram control.

    Declaration
    public string FontFamily { get; set; }
    Property Value
    Type
    System.String

    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
    System.Drawing.StringAlignment

    Italic

    Gets or sets to indicate whether this font has the italic style to truly slanted and appear in Diagram control.

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

    Lower

    Gets or sets a value indicating whether text is lower.

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

    MaxSize

    Gets or sets the maximum size that the text box can grow to.

    Declaration
    public SizeF MaxSize { get; set; }
    Property Value
    Type
    System.Drawing.SizeF

    MinSize

    Gets or sets the minimum size the text box can be.

    Declaration
    public SizeF MinSize { get; set; }
    Property Value
    Type
    System.Drawing.SizeF

    PointSize

    Gets or sets size of font in points.

    Declaration
    public float PointSize { get; set; }
    Property Value
    Type
    System.Single

    Strikeout

    Gets or sets a value that indicates whether this font specifies a horizontal line through the text in Diagram control.

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

    Subscript

    Gets or sets a value that indicates whether a distinguishing character or symbol written directly beneath or next to and slightly below the text.

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

    Superscript

    Gets or sets a value indicating whether text is superscript. Not used in TextNode

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

    TextColor

    Gets or sets a value that indicates to specify the color of the text in Diagram�s TextEditor.

    Declaration
    public Color TextColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    Underline

    Gets or sets a value that indicates whether to underline the text in Diagram�s TextEditor.

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

    Upper

    Gets or sets a value indicating whether text is upper.

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

    Methods

    BeginEdit(Node)

    Starts editing node.

    Declaration
    public bool BeginEdit(Node nodeEditing)
    Parameters
    Type Name Description
    Node nodeEditing

    node to edit

    Returns
    Type Description
    System.Boolean

    success operation value

    EndEdit(Boolean)

    Saves the changes made in the control to the attached text node and ends edit mode.

    Declaration
    public void EndEdit(bool bSaveChanges)
    Parameters
    Type Name Description
    System.Boolean bSaveChanges

    Save the changes made in the control.

    OnEditorTextChanged(EditorTextChangedEventArgs)

    Raises the EditorTextChanged event.

    Declaration
    protected virtual void OnEditorTextChanged(EditorTextChangedEventArgs evtArgs)
    Parameters
    Type Name Description
    EditorTextChangedEventArgs evtArgs

    The EditorTextChangedEventArgs instance containing the event data.

    OnKeyDown(KeyEventArgs)

    Raises the System.Windows.Forms.Control.KeyDown event.

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.KeyEventArgs e

    A System.Windows.Forms.KeyEventArgs that contains the event data.

    OnTextChanged(EventArgs)

    Called when the text in the control changes.

    Declaration
    protected override void OnTextChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    Event arguments.

    Remarks

    If the auto-resize option is turned on, this method resizes the control so that the text fits.

    ProcessCmdKey(ref Message, Keys)

    Gets a value indicating the state of the System.Windows.Forms.TextBoxBase.ShortcutsEnabled property.

    Declaration
    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    Parameters
    Type Name Description
    System.Windows.Forms.Message msg

    A System.Windows.Forms.Message, passed by reference that represents the window message to process.

    System.Windows.Forms.Keys keyData

    One of the System.Windows.Forms.Keys values that represents the shortcut key to process.

    Returns
    Type Description
    System.Boolean

    true if the shortcut key was processed by the control; otherwise, false.

    Events

    EditorTextChanged

    Occurs when text changed.

    Declaration
    public event EditorTextChangedEventHandler EditorTextChanged
    Event Type
    Type
    EditorTextChangedEventHandler

    Implements

    ITextEditor
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved