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

Comment/Uncomment

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
LockWindowUpdate(this.editControl.Handle.ToInt64());
editControl.se
for (int i = 1; i <= this.editControl.PhysicalLineCount; i++)
{
this.editControl.InsertText(i, 1, "-- ");
}

//Resume Painting
LockWindowUpdate(0);

1 Reply

AD Administrator Syncfusion Team 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.

Example:

For C# :



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

Sample

Please let me know if this meets your requirements.

Thanks for your patience.

Regards,
Manohari.R

Loader.
Live Chat Icon For mobile
Up arrow icon