如何在Visual Studio工具栏添加Run、Compile按钮以替代快捷键
Got it, let's ditch those keyboard shortcuts and get your handy Run and Compile buttons right on the toolbar where you can see 'em. Here's a straightforward walkthrough that works for most recent Visual Studio versions (2019, 2022, etc.):
- First, open the customization menu: Right-click any empty spot on your existing toolbar (like next to the "Save" or "Undo" buttons) and select
Customize.... Alternatively, hitAlt + T, Cto jump straight to it. - Add the Compile button:
- In the pop-up
Customizewindow, switch to theCommandstab. - On the left, pick the
Buildcategory from the list. - Scroll through the right-hand
Commandslist until you findCompile—it might have a small hammer icon next to it. - Click and drag this command directly onto your toolbar, then let go. It'll snap into place immediately.
- In the pop-up
- Add the Run (Start Without Debugging) button:
- Still in the
Commandstab, switch the left category toDebug. - Look for
Start Without Debuggingin the right list—this is the exact action tied toCtrl + F5. - Drag it to your toolbar, right next to the Compile button if you want them grouped together.
- Still in the
- (Optional) Tweak the button look: Right-click the new buttons on your toolbar, hover over
Button Appearance, and chooseImage Only,Text Only, orImage and Textdepending on your preference.
Pro tip: If you can't find the commands quickly, use the Find box at the bottom of the Commands tab—type "Compile" or "Start Without Debugging" and it'll filter the results instantly.
内容的提问来源于stack exchange,提问作者Faizan Haidar Khan
相关产品推荐
相关产品推荐

