Alex Rivera | Logout

Is it possible to tell Visual Studio not to treat a source file as a "component"?

Asked 2010-01-26T10:09:25.110
26

Possible Duplicate:
Is there an attribute I can add to a class so it will be edited as code, not in the designer?

Class with System.ComponentModel.Component on their inheritance path are automatically treated as "components" within Visual Studio (2008), triggering a different icon for the source file:

While the icon does not really matter, the changed double click behavior is really annoying: instead of opening the source code in the text editor, Visual Studio now shows a screen encouraging me to add components to my class by dragging them "from the Toolbox". I do not want to do that!

I am aware that I can right click the source file and choose "View Code", but whenever I forget to do this, I am stuck waiting for a dialog which is absolutely useless. Is there any way to disable the component behavior (preferably in the source code)?

Edit
Report

1 Answer

0

You could right-click the source file, choose "View Code", then click "Set as Default". It's a bit of a blunt instrument, but if you have more false components in your solution than real components, then you may find it convenient.

answered 2010-01-26T11:32:10.910

Your Answer