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.
Unfortunately, activation email could not send to your email. Please try again.

How to get the RichTextEdit derived from RichTextNode

Thread ID:

Created:

Updated:

Platform:

Replies:

74207 Jun 3,2008 10:35 AM Jun 6,2008 05:07 AM Windows Forms 1
loading
Tags: Diagram
miya dada
Asked On June 3, 2008 10:35 AM

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



Administrator [Syncfusion]
Replied On June 6, 2008 05:07 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;