Link to home
Start Free TrialLog in
Avatar of riceman0
riceman0

asked on

How to make visual studio 2010 treat file as plain code, not custom control?

I'm using visual studio 2010, and I've got a file what contains my own namespace and a bunch of my own classes.  One of these classes is derived from a .NET object, a contextmenu.  Because of this, my workspace explorer treats it as a custom user control (see 'ODL' below).    User generated image
This not only changes the icon, but changes the double-click action -- now when I double click on it it tries to open a designer, which does not exist and I get an error.  It takes several clicks to get to the code.  This is a nuisance that turns into a major pain after the thousandth time.

Is there any way -- maybe an attribute or something -- to convince the solution explorer that it's just code, not a custom user control -- without separating my code into different pieces.

Thanks for any help.
Avatar of kaufmed
kaufmed
Flag of United States of America image

If you ONLY want the code-behind file and not the stuff that comes with the designer, then you can delete the designer.vb file by selecting "Show All Files" and then expanding the node next to ODL.vb. Delete the desinger.vb and .resx files and you'll be left with just the code-behind. Take note, however, that any controls you may have placed on the user control would have been declared in the designer.vb file and will cause errors in your code-behind due to no longer having the controls defined.

 User generated image User generated image
If you are simply trying to find a quick way of getting to the code, then you can right-click ODL.vb and select "View Code".

 
Untitled2.png
Avatar of riceman0
riceman0

ASKER


Thanks, but no additional files show up when I view all files, so nothing to delete -- and it has a different icon, maybe I misspoke and it is not a user control -- not sure what my icon indicates, maybe a composite control?

I should've put it more simply -- I'm trying to restore the double click action that brings up the code window.  Its a piddling request I know, but it seems like there ought to be an attribute to have VS treat it like a code file -- since that's actually what it is.  
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial