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

inserting code snippets programmatically

Hi,

Is there a sample or documentation on how to insert code snippets programmatically? I'd like to add it to the edit control's context menu.

thanks!

-travis

3 Replies

GR Golda Rebecal Syncfusion Team November 3, 2007 05:20 AM UTC

Hi Travis,

Code snippets feature is implemented by using many internal methods and they are not exposed. Hence it is not possible to use this feature programmatically.

Kindly let me know if you have any questions.

We appreciate your interest in Syncfusion products.

Best regards,
Golda



TR travis November 7, 2007 02:01 AM UTC

Let me clarify. I'd like to have a context menu entry called something like "Insert code snippet..." that when chosen would simply pop up the code snippet picker in the editor on the current line (as if Ctrl+`) was pressed. Is something like this possible?

If no method exists to do this, could I simulate a Ctrl+` key press when the context menu item is selected?

thanks,
Travis


GR Golda Rebecal Syncfusion Team November 7, 2007 08:11 AM UTC

Hi Travis,

You can pop up the code snippet picker in the EditControl by using ShowCodeSnippets() method of EditControl

Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Edit/F69565/main.htm

Kindly let me know if this helps you.

Best regards,
Golda

Loader.
Live Chat Icon For mobile
Up arrow icon