有没有办法让Visual Studio默认显示控件/表单的代码而不是设计器?我倾向于不是设计师的粉丝,因为他们增加膨胀.
小智 8
用[System.ComponentModel.DesignerCategory("")]装饰你的类,例如:
[System.ComponentModel.DesignerCategory("")]
public class MySpecialButton : System.Windows.Forms.Button
{
}
Run Code Online (Sandbox Code Playgroud)
我喜欢在设计视图中打开我的表单,但是我创建了一个只有代码的部分类文件,Visual Studio希望一直在设计视图中打开它.要防止Visual Studio意识到Designer可以加载特定的源文件,请查看csproj文件以获取相应源文件的Compile Include标记,并删除其下面的SubType标记.
我最近自己遇到了这个问题,上述解决方案并没有解决我的问题。我需要进入Tools | Options
并更改HTML Designer
to的设置Enable HTML designer
并选择Start pages in: Source View
.
归档时间: |
|
查看次数: |
26906 次 |
最近记录: |