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?
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?
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
I just learned this trick from a friend. Put your code inside these 2 statements and it will be commented out.
#if false
#endif
Highlight block of text, then:
Comment Block: Ctrl + K + C
Uncomment Block: Ctrl + K + U
Tested in Visual Studio 2012
VB.NET doesn't support for multi line comment.
The only way to do multi-line comments in VB.NET is to do a lot of single line comments('
).
Or just highlight the whole code and just use (Ctrl+E,C)
, (Ctrl+E,U)
to comment or uncomment.
Only in c# /* */
Or in ASP.NET html source using <!-- -->
.
The only way I could do it in VS 2010 IDE was to highlight the block of code and hit ctrl-E and then C
Create a new toolbar and add the commands
Select your custom tookbar to show it.
You will then see the icons as mention by moriartyn