Class RichTextEdit
RichTextBox control for editing text objects.
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Windows.dll
Syntax
public class RichTextEdit : RichTextBox, ITextEditor
Remarks
This class implements a text box control that is used for editing text nodes derived from RichTextNode.
RichTextNodeConstructors
RichTextEdit(IViewer)
Initializes a new instance of the RichTextEdit class.
Declaration
public RichTextEdit(IViewer view)
Parameters
Type | Name | Description |
---|---|---|
IViewer | view | View that is hosting the text edit control. |
Properties
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 the selection char offset.
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 |
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 the selected text has superscript property.
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)
Loads and positions the text edit control and goes into edit mode.
Declaration
public bool BeginEdit(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node | Node to edit. |
Returns
Type | Description |
---|---|
System.Boolean | True if editing started; otherwise False. |
Remarks
This method loads the control with the text value and properties of the attached text node. It also positions the control to correspond to bounds of the text node. Then it hides the text node and makes the control visible.
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 | if set to |
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. |
OnKeyUp(KeyEventArgs)
Raises the System.Windows.Forms.Control.KeyUp event.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e | A System.Windows.Forms.KeyEventArgs that contains the event data. |
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 |