<分区>
Possible Duplicate:
Is there an attribute I can add to a class so it will be edited as code, not in the designer?
继承路径上带有 System.ComponentModel.Component
的类在 Visual Studio (2008) 中被自动视为“组件”,触发源文件的不同图标:
虽然图标并不重要,但更改后的双击行为确实令人讨厌:Visual Studio 现在显示一个屏幕,鼓励我将组件添加到我的类中,方法是将它们“从”工具箱”。我不想那样做!
我知道我可以右键单击源文件并选择“查看代码”,但每当我忘记这样做时,我就会一直等待一个毫无用处的对话框。有什么方法可以禁用组件行为(最好在源代码中)?