Skip to the main content

Visual Studio

Toggle line comments

Ctrl/

Windows Desktop app Visual Studio 2022, General profile

Practice this

Press Ctrl + Slash to toggle line comments in Visual Studio. It is listed for Windows, and no Mac version is documented here.

Where it works: Text editor

Needs Visual Studio 2022 version 17.11 or later. Ctrl and K, then Ctrl and slash, works too. These are the defaults for Visual Studio's General settings profile. Other profiles change them.

Where this comes from

Keyboard shortcuts in Visual Studio - Microsoft Learn

Documentation checked on 2026-09-14. That is a documentation review, not a test run inside the application.

Report a correction