Visual Studio: Make view code default using attribute

后端 未结 3 397
醉酒成梦
醉酒成梦 2021-01-18 16:18

I know how to configure VS 2008 to open windows forms controls in code instead of the designer. But I think I have seen a way I could do this with an attribute I could decor

3条回答
  •  一生所求
    2021-01-18 17:02

    I think I have found where you already seen that: the Brian Ensink's blog. You can use the DesignerCategory attribute to mark class in order to choose how they are opened:

    • If you inherit a class from System.Windows.Form, it will be open by the designer view.
    • If you add the [System.ComponentModel.DesignerCategory("")] attribute, it will be open by the code view.

提交回复
热议问题