XTab's Blog

Ged Mead's Blog at vbCity

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

FebMarch 2006Apr
SMTWTFS
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678

Archives

Topics

Ramblings

VB.NET

Wednesday, March 08, 2006 #

   Here's a little tip.   Actually, it's so small that it's probably no more than a Tipette, A Tipchen (for German readers) or a Tipling ....  oh wait!  Isn't that what I do every night after work? 

   Anyway, enough preamble.   If you are in one of those not uncommon situations where you temporarily want your project to ignore a block of code, how do you do this?      Maybe your preferred way is to comment out each of the lines in that code block?     That is, manually go down line after line and insert the apostrophe, using the down arrow...?  If so, I have good news for you: there is a much easier way.

   Here's how.   There is a really handy set of key press combinations you can use in Visual Studio.

   To comment out a block:

1.        Select the block you want to comment out by dragging over it with the mouse and with the left mouse button held down.

2.        Press the Ctrl key and the letter K key at the same time.  (Nothing visible will happen yet.)

3.        Release those two keys.

4.        Then press the Ctrl key and the letter C key at the same time.

5.        Automagically, the selected code block will be commented out.   It’s a real time saver.

 

To uncomment a block of code back in again, follow all the steps above, except that in Step 4 you use the Ctrl key and the letter U (for Uncomment) at the same time.   Neat. Huh?

 

  

posted @ 5:38 AM