How to: Comment Out Lines of Code (C# Express)

The Visual C# Express Edition Code Editor provides the ability to quickly comment out code. You can also remove the comments just as easily.

To comment out lines of code

  1. Highlight the block of code you wish to convert into comments in the Code Editor.

  2. From the Edit menu, select Advanced, and then Comment Section, or press CTR+E, then C.

    There is also a Comment Section button on the Text Editor toolbar.

  3. The Code Editor precedes each line in the highlighted block with //, converting it into a comment.

See Also

Other Resources

Visual C# Express

Using the Visual C# Express IDE

Visual C# Express Tips and Tricks