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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





50520 Oct 13,2006 01:20 AM UTC Oct 14,2006 08:46 AM UTC WinForms 1
Tags: EditControl
Scott Swartz
Asked On October 13, 2006 01:20 AM UTC

I''d like to have toolbar buttons that comment and uncomment the selected text.

There is a editControl.CommentSelection() function but it doesn''t appear to do anything and the help for that method has zero details. I assume that I need to specify what I consider a comment to be (i.e., in C# it would be "//"), but I can''t figure out how to do that.

I also found the following code in one of their downloadable samples. If they hane comment and uncomment methods, I''m not sure why they have this code sample.

Any help would be appreciated. Thanks.

//Lock Painting
for (int i = 1; i <= this.editControl.PhysicalLineCount; i++)
this.editControl.InsertText(i, 1, "-- ");

//Resume Painting

Administrator [Syncfusion]
Replied On October 14, 2006 08:46 AM UTC

Hi Scott,

Our apologies for the delayed response. For EditControl.CommentSelection method to work properly the StartComment attribute of ConfigLanguage tag of the language configuration definition has to be defined in the XML configuration file.


For C# :

I have attached a sample that illustrates this in this link given below.


Please let me know if this meets your requirements.

Thanks for your patience.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon