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.

VBScript Comment/Uncomment

Thread ID:

Created:

Updated:

Platform:

Replies:

88233 Jul 17,2009 09:56 AM Aug 21,2009 12:49 AM Windows Forms 2
loading
Tags: EditControl
John Brett
Asked On July 17, 2009 09:56 AM


Using the predefined VBScript syntax, the Comment Selection command works, surrounding the code with an xml comment .

For my purposes, I've changed this to use the VBScript REM command, and the Editor works correctly on commenting again.

However, in neither case does the Uncomment command work. It simply does nothing (no exceptions are thrown, nothing is written to the debug window). Can you tell me why this doesn't work?

John

Nandakumar R [Syncfusion]
Replied On August 21, 2009 12:48 AM

Hi,

I regret for the inconvenience caused. Your DirectTrac incident has been updated with the details. There seem to be some issues with the lexem based changes when you try to make one. You can use the following workaround in the uncomment section and achieve this behaviour.

[C#]

private void Form1_Load(object sender, EventArgs e)
{
//Set start and end comment
this.editControl1.LoadFile(@"VBScriptSource.vbs");
this.editControl1.ApplyConfiguration(KnownLanguages.VBNET);

IConfigLanguage lan = this.editControl1.Language;
lan.StartComment = "REM ";
lan.EndComment = "";
}

private void btnComment_Click(object sender, EventArgs e)
{
//Comment
this.editControl1.CommentLine();
}

private void btnUncomment_Click(object sender, EventArgs e)
{
//Uncomment
this.editControl1.UnCommentLine();
string CommentedText = this.editControl1.SelectedText;
CommentedText = CommentedText.Replace(@"REM ", "");
editControl1.SelectedText = CommentedText.Replace(@"REM ", "");
editControl1.SelectionCancel();
}


Regards,
Nanda

Nandakumar R [Syncfusion]
Replied On August 21, 2009 12:49 AM


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.

;