开发者

multiline comment in vb.net

Do we have a multi line comment in VB.net.

I know in 开发者_Python百科Java we have /* */ but that doesn't seem to work here.


No we dont unfortunately..........

You can do: Ctrl + K, Crtl + C

To uncomment ctrl+k ctrl+u


In Visual Basic .Net 2008 and 2010, I use the following C++ Workaround.

#If AFAC Then

#End if

For english speaking AFAC = "à effacer" = "to delete"

I alreay use #If COMMENT or #If TODO

The #if COMMENT then solution is more power than the C++/Java/C# /* text */ solution because it is possible to imbricate (embed) #if but not /* !!!

For more information see the following link


Just hold "alt"+"shift" and move cursor up or down to select lines, and press " ' "


Not possible. Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.

But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you.


Only single-line comments are possible in VB, unlike C/C++ and it's derivatives (Java, JavaScript, C#, etc.). You can use the apostrophe " ' " or REM (remark) for comments like this:

Sub Main()  
    ' This is a comment  
    REM This is also a comment  
End Sub  

But there is no multi-line comment operator in VB, unless you count using the keyboard shortcuts like @JonH and @Tedd Hansen said.


you can do on all visual studio version ..

#Region "mycomment"
 'comment line1
 'comment line2
#End Region

you will be able to hide and show the entire block

multiline comment in vb.net

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜