Keyboard accelerators are configurable. You can find out which keyboard accelerators are bound to a command in Tools -> Options
on the Environment -> Keyboard
page.
These commands are named Edit.CommentSelection and Edit.UncommentSelection.
(With my settings, these are bound to Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U. I would guess that these are the defaults, at least in the C++ defaults, but I don't know for sure. The best way to find out is to check your settings.)
You can also add the toolbar in Visual Studio to have the buttons available.
View > Toolbars > Text Editor
Use the keys CtrlK,C to comment out the line and CtrlK,U to uncomment the line.
From your screenshot it appears you have ReSharper installed.
Depending on the key binding options you chose when you installed it, some of your standard shortcuts may now be redirected to ReSharper commands. It's worth checking, for example Ctrl+E, C is used by R# for the code cleanup dialog.
This is how I did it,
Menu Tools → Options on the Environment → Keyboard window
One can alter the default shortcuts following the below steps
I went to menu: Tools → Options.
Environment → Keyboard.
Show command containing and searched: comment
I changed Edit.CommentSelection and assigned Ctrl+/ for commenting.
And I left Ctrl+K then U for the Edit.UncommentSelection.
These could be tweaked to the user's preference as to what key they would prefer for commenting/uncommenting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With