From the files of Stupid Keyboard Tricks
How to quickly (really quickly) comment out blocks of code
|NT, 9x, 2000
Since version 1.0 VB lacked a block comment feature that C/C++ programmers
love so dearly. Finally in version 5, the mothership provided us with
half of the solution - one could now go to the Customize menu and add the
Comment Block and Uncomment Block button to the toolbar or the menu. And
that was good. But if you are a keyboard jockey like us, you want
something faster and preferably something faster than the /*...*/ operator in
C/C++. This is the story of how to do it:
- Right click on the toolbar and select Customize... menu
- Under Categories click on Edit, then select Comment Block in the Commands
- Now drag the Comment Block entry onto the Menu Bar (yep! the menu
- You should now see a new icon on the menu bar.
- Make sure that the new icon is highlighted (it will have a black square
around it) and click Modify Selection button on the Customize dialog box.
- An interesting menu will popup. Under name, add an ampersand to
the beginning of the entry. So now instead of Comment Block it should
read &Comment Block. Press Enter to record the change.
- Click on the Modify Selection button once again and select Image and
- Dismiss the Customize dialog box.
- Now highlight any block of code and press Alt-C. Voila.
- Do the same thing for the Uncomment Block or any other commands that you
find yourself using often.