在很多类前面都看到[System.ComponentModel.DesignerCategory("Code")]这么一句话,不知道作用是什么,查查csdn,虽然有,但可能是理解能力低,没有看懂什么意思,最后只能搜一下英文的网站,发现老外说事情比较浅显,通俗易懂呀!!!!
For those of you who like certain control classes to open in the code view (instead of the designer view) by default. You can use the following attribute on your class so when you double click on it you get the code view.
- [System.ComponentModel.DesignerCategory("Code")]
I know this has been a nicety that I now use often.
说白了就是在解决方案中双击一个.cs文件,以“代码”而不是以“设计器”打开这个文件。
本文解释了C#中[System.ComponentModel.DesignerCategory("Code")]的作用。该属性用于指定某些类默认以代码视图而非设计视图打开,适用于希望直接编辑源代码的场景。
1万+

被折叠的 条评论
为什么被折叠?



