visual-studio 如何在 Visual Studio 中设置默认的双击操作?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/633191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:15:43  来源:igfitidea点击:

How can I set the default double click action in Visual Studio?

visual-studiodefaultview

提问by Hao

How can I make Visual Studio default to View Source when you double-click the Form1.cs. I prefer to make View Source the default of double-click than View Designer.

双击Form1.cs. 与视图设计器相比,我更喜欢将“查看源”设为双击的默认设置。

回答by Paul Stovell

Right click the file in the Solution Explorer, choose "Open With...", select the CSharp Editor, and click the "Set as Default" button.

右键单击解决方案资源管理器中的文件,选择“打开方式...”,选择 CSharp 编辑器,然后单击“设为默认值”按钮。

回答by Chris Hynes

Right click a form file and click "Open With...". Pick your desired designer to open as default (in this case "CSharp Editor" or "Microsoft Visual Basic Editor") and click "Set as Default". Voila.

右键单击表单文件,然后单击“打开方式...”。选择您想要的设计器以默认打开(在本例中为“CSharp 编辑器”或“Microsoft Visual Basic 编辑器”),然后单击“设为默认值”。瞧。

回答by Frank

with this attribute myClass will open in the code editor and not the designer:

使用此属性 myClass 将在代码编辑器而不是设计器中打开:

[System.ComponentModel.DesignerCategory("")]
public class myClass : Form
{

}