开发者

How to stop visual studio from opening my winforms controls in the designer

When I want to edit/view the code for a winforms control/form i created, I need to right-click in the solution and select "view code". The default action for opening the file is "view designer". This appears to be the case for any C# file containing a class that inherits from a winforms control, even if this is indirectly.

The daft thing is that VS does this if it can't run the designer (for instance when the control is not the first class in the file).

Is there hint or att开发者_StackOverflow社区ribute or workaround to stop VS from doing this?


Decrotate your Form or Control that should open in code view with [System.ComponentModel.DesignerCategory("Code")]


  • Right-click on a file in your solution
  • Select "Open With..."
  • Select "CSharp Editor"
  • Click "Set as Default".
    (In a web application, you need to select "Web Form Editor")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜