[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-03-19
4
Medium Priority
?
367 Views
Last Modified: 2012-05-11
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).    solution explorer
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.
0
Comment
Question by:riceman0
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35174225
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.

 Show All Files Designer Files to Remove
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
0
 

Author Comment

by:riceman0
ID: 35174252

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.  
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 35174282
Try opening your project file (.vbproj) inside of text editor and see what the "Subtype" is listed as for ODL.vb.

For example, here's what the node for a new component file I added to a sample project looks like:
<Compile Include="Component1.vb">
    <SubType>Component</SubType>
</Compile>

Open in new window

0
 
LVL 5

Assisted Solution

by:samml
samml earned 1000 total points
ID: 35175043
This does not really solve your specific problem but I use F7 to show the code and Shift+F7 to get the designer. If you do so, you don't have such problems.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question