By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,184 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,184 IT Pros & Developers. It's quick & easy.

VS2005 c# multi-line comments

P: n/a
Hi,

If I start a multi-line comment in a c# file with /* then when I press
enter, I get an asterisk indented on the next line.
I want to prevent this from happening, as it's getting really annoying.
I've been through all the settings but I couldn't see one that might
change this behaviour - although I would have thought it should be there
somewhere!

Can anybody tell me how to change this behavoiur?

Thankyou.
Paul
Aug 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Paul Cheetham wrote:
Hi,

If I start a multi-line comment in a c# file with /* then when I press
enter, I get an asterisk indented on the next line.
I want to prevent this from happening, as it's getting really annoying.
I've been through all the settings but I couldn't see one that might
change this behaviour - although I would have thought it should be there
somewhere!

Can anybody tell me how to change this behavoiur?

Thankyou.
Paul
Tool Options Formatting Smart comment editing
Aug 9 '06 #2

P: n/a
David,
Tool Options Formatting Smart comment editing
This option is not available in Visual Studio 2005 which the original poster
is using. In VS2005, one needs to use this option instead:

Tools Options Text Editor C# Advanced Generate XML documentation
comments for ///.

Although the name of the option only speaks about the /// comments (three
slashes), this option also affects the auto-creation of a star character
when one types in /* (slash star) and presses Enter. With this option off,
the star won't be generated automatically on the new line.

However, one doesn't need to disable this option altogether, as it can be
useful sometimes. Instead, one can type in /* and then press
Ctrl+Shift+Enter to move to the next line. The star won't be automatically
added. The Ctrl+Shift+Enter key corresponds to the Edit.LineOpenBelow action
and can be customized using Tools Options Environment Keyboard.

A list of the Visual Studio 2005 keyboard shortcuts is available for example
here:

http://www.codinghorror.com/blog/fil...0Shortcuts.htm

Another useful way to comment a block of code (as I assume the original
poster is doing) is to select a block of code, and then press Ctrl+K,C to
comment it. To uncomment, one has to press Ctrl+K,U.

Hope this helps.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Aug 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.