Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multi line comment vb.net in Visual studio 2010 [duplicate]

Possible Duplicate:
commenting VB code
Lack of block comments in VB .NET?

How to?

Is there a way to comment out more than one line of code in vb.net using VS 2010?

like image 373
sarsnake Avatar asked Mar 10 '11 00:03

sarsnake


People also ask

How do you comment multiple lines in Visual Studio 2010?

How do you comment out multiple lines in Visual Studio code? Comment Code Block Ctrl+K+C/Ctrl+K+U If you select a block of code and use the key sequence Ctrl+K+C, you'll comment out the section of code. Ctrl+K+U will uncomment the code.

How do I comment multiple lines in Visual Studio VB Net?

You can use Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U to comment or uncomment selected lines of text.

How do you comment multiple lines in Visual Studio?

ctrl + shift + A worked for me for adding multi-line comment.

How do you bulk comment in Visual Basic?

In Visual Studio . NET you can do Ctrl + K then C to comment, Crtl + K then U to uncomment a block.


2 Answers

The only way is to highlight the lines to comment and press

ctrl + k, ctrl + c

or after highlighted press the toolbar option to comment out the selected lines.

The icons look like this enter image description here

like image 51
nickmoriarty Avatar answered Sep 30 '22 02:09

nickmoriarty


I just learned this trick from a friend. Put your code inside these 2 statements and it will be commented out.

#if false

#endif
like image 20
user1985128 Avatar answered Sep 30 '22 03:09

user1985128