We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to get the RichTextEdit derived from RichTextNode

Hi,

I am evaluating the syncfusion diagram components.
I have added a RichTextNode to the diaram, and I pasted a OLE object to the RichTextNode. It works so fine.
Would you please tell me:
1. How to get the RichTextEdit which derived from RichTextNode?
2. How to catch the double-click event of the RichTextNode, and redirect this event to the OLE object in the RichTextNode?

Any help would be appreciated.

Regards,
KAWABE



1 Reply

AD Administrator Syncfusion Team June 6, 2008 09:07 AM UTC

Hi Kawabe ,

1. Get RichTextEditor:

RichTextEdit implements a text box control that is used for editing text nodes derived from RichTextNode. Please use the following code snippet.

RichTextEdit m_richEditor= new RichTextEdit(this.diagram1.Controller.Viewer);
//To bring the edit mode
m_richEditor.BeginEdit(richTextNode);
//To disable the edit mode
m_richEditor.EndEdit(true);

Please refer to the attached sample that demonstrates this completely.

http://websamples.syncfusion.com/samples/Diagram.Windows/F74207/main.htm

In this sample when you select the RichTextNode and click File->BeginEdit menuitem you can bring the edit mode. When you click File->EndEdit menuitem you can end the editing.

2. Catch the double-click event of the RichTextNode:

You can derive the GroupNode and add add the RichTextNode in the group. You can call OnMouseDoubleClick() method to fire double click event of the RichTextNode. Please refer to the following code snippet.

class MySymbol:Group
{
public MySymbol()
{
RichTextNode richTextNode = new RichTextNode(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}
{\f1\fnil\fcharset0 Century Gothic;}{\f2\fnil\fcharset0 Estrangelo Edessa;}}
\cf3\b\f1\fs18 RichText\cf0\b0\f0\fs17 node allows \b diagrams\b0 to be built using
\cf4\ul\i multi-colored\cf0\ulnone\i0 text with different \b\f2\fs20 font styles
\b0\f0\fs17 and \i\fs20 sizes.\par}", new RectangleF(100, 100, 140, 50));
this.AppendChild(richTextNode);
}
protected override void OnMouseDoubleClick()
{

base.OnMouseDoubleClick();
}

}

Please let me know if this helps.

Regards,
Nagaraj


Loader.
Live Chat Icon For mobile
Up arrow icon